# Business Logic - JKKSeikyKeiBunkatsuCC.seikyBunkatsu() [660 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | com.fujitsu.futurity.bp.custom.common.JKKSeikyKeiBunkatsuCC |
| Layer | CC / Common Component (Controller Component, shared business logic router) |
| Module | common (Package: com.fujitsu.futurity.bp.custom.common) |

## 1. Role

### JKKSeikyKeiBunkatsuCC.seikyBunkatsu()

The seikyBunkatsu method serves as the central billing contract routing and dispatch engine for the FPT (Fujitsu Platform Telecommunications) order fulfillment system. Its Japanese name translates to "Billing Item Classification" - it classifies incoming service contract data and dispatches to the appropriate billing sub-processes based on payment method, service type, and contract state. The method handles three primary service categories: ENUM (fiber-optic internet, service code "51"), Electric (service code "05", mapped via constant JKKStrConst.CD00130_05), and other telecom service types including FTTH, TV (K-CAT, KCN), Mansion, and Mail services. It implements a routing/dispatch pattern with cascading conditional branches driven by the shiharaiCd (payment method code) to route through distinct payment-processing pipelines: Mail/Money Order (shiharaiCd = "2" or "3"), Credit Card (shiharaiCd = "4"), or direct billing (other values). The method plays the role of a shared orchestrator called by multiple screens and BPM flows (KKSV0403, KKA15301, KKW01601), functioning as the single entry point that coordinates acceptance registration, payment authorization, billing contract setup, charge contract changes, optional service management, invoice generation, construction work updates, progress status tracking, discount application, CIC (third-party credit) checks, and cancellation processing - all within a single transactional boundary.

## 2. Processing Pattern (Detailed Business Logic)

The method processes the service contract data in the following sequential stages:

### Stage 1 - Initialization and Parameter Extraction

1. Create a ServiceComponentRequestInvoker instance for SC calls
2. Extract workMap from param and set sysDateTimeStamp
3. Extract parameters from ccMsg: futureFlg, shiharaiCd, shinsaKekkaCd, seiOpSvcKeiDslFlg, ekk0251RunFlg, ido_div, prcGrpCd
4. Retrieve svc_list (service contract list) and get first item as childMap

### Stage 2 - Service Contract Status Check

5. Check the service contract state code (stateCd) to determine if the contract is "Accepted" ("010")
6. If stateCd = "010" (Accepted):
   - Check if service code is ENUM ("51") or Electric ("05" via JKKStrConst.CD00130_05)
   - If ENUM or Electric: set ukState = true (process as un-accepted)
   - Otherwise: set ukState = false (contract already accepted)
7. If stateCd is NOT "010": set ukState = true

### Stage 3 - Acceptance Registration (when ukState = true)

8. Execute acceptance registration via execEKK0011D020
9. If func_code = "1", retrieve mskmNo from ccMsg; otherwise use mskmNo from childMap

### Stage 4 - Payment Method Routing

#### 4a. Mail/Money Order Path (shiharaiCd = "2" or "3")

10. Execute money transfer procedure (execEKK0501D010)
11. Request money transfer review (execEKK0501C030)
12. If shinsaKekkaCd = "0": register OK result (execEKK0501C080)
13. If shinsaKekkaCd != "0": register NG result (execEKK0501C090)

#### 4b. Credit Card Path (shiharaiCd = "4")

14. If shinsaKekkaCd is null (unreviewed):
15. If func_code = "1" (Update mode):
    - Execute initial authorization via execEKKA0010004
    - Get transaction result code and approval result code
    - If ERR: set err_flg, call editErrInfo, throw CCException
    - If NG: set err_flg, call editErrInfo, throw CCException
    - Set prg_stat to "800" (KKKFamiilyPackConst.CD00647_0800)
    - Set isFauthori = true
    - Execute credit card company consent (execEKK0531A010)
16. Set pay_skekka_cd = "40" (KKKFamiilyPackConst.CD00249_40)
17. If func_code = "1":
    - Get card type and issuer division from kksv040333sc
    - If either is null: execute card company consent (execEKK0521A010)
    - Execute credit request (execEKK0521D010)
18. Execute credit review request (execEKK0521C030)
19. If shinsaKekkaCd is null or "0": register OK (execEKK0521C110)
20. If shinsaKekkaCd = "1": register NG (execEKK0521C120)

### Stage 5 - Billing Contract Registration

21. Execute billing contract registration (execEKK0491D010)

### Stage 6 - Credit Card Initial Auth Registration (when shiharaiCd = "4" and shinsaKekkaCd is empty)

22. If func_code = "1": execute initial auth registration (execEKK1031D010)

### Stage 7 - Charge Contract Changes (Loop over svc_list)

23. For each service contract in svc_list:
24. Execute charge contract change (execEKK0321C020)
25. If prcGrpCd != "99" and futureFlg is empty and state != "010":
    - Execute fee course consent (execEKK0791A010)
    - If id_tchisho_hak_skbt_cd != "0": execute instruction registration (execECK0151D010)

### Stage 8 - Optional Service Contract Cancellation

26. If seiOpSvcKeiDslFlg = "1":
27. Get seiOpKeiState from childMap
28. Execute optional service contract consent (execEKK0441A010)
29. If seiOpKeiState = "010" (Accepted) or "020" (Under Review):
    - Execute contract cancel (execEKK0441C210), set jikkouFlg = "1"
30. Otherwise:
    - Execute contract cancellation (execEKK0441C230), set jikkouFlg = "2"
    - If func_code = "1": execute cancellation confirmation (execEKK0441C240)

### Stage 9 - Invoice Generation (for net services)

31. Calculate iStateCd from stateCdMax
32. If yh = "1" (invoice required) AND svcCdFlg = "1" (net service):
    - Execute optional service contract registration (execEKK0441D010)
    - If iStateCd >= 20: execute contract review (execEKK0441C030)
    - If iStateCd >= 30: execute contract conclusion (execEKK0441C040)
    - If iStateCd >= 100 AND <= 220:
        - Validate seikyYm and svcChrgYmd; if seikyYm set but svcChrgYmd empty: return error (E_CHRG)
        - Execute contract start (execEKK0441C070)
    - Execute reservation application (execEKK0441C060)
    - Set jikkouFlg = "3"

### Stage 10 - Payment Method Notification Email Control

33. If kksv040331_paywaytcml_ctl_cd is set: execute payment method notification email control (execEKK0491C250)

### Stage 11 - Construction Work Variations

34. If kojiakNo is not empty:
35. If prcgrpcdKoji = "02" (Net Home Type) or ("10" (Phone) AND manbukcd is empty):
    - Execute Net Home variations (execEKU0021C010)
36. If prcgrpcdKoji = "11" (TV K-CAT) or "13" (TV Re-transmission):
    - Execute TV variations (execEKU0031C010)
37. If prcgrpcdKoji = "12" (TV KCN):
    - Execute TV line variations (execEKU0041C010)
38. If prcgrpcdKoji = "03" (Net Mansion), "04" (Net Mezono), or ("10" AND manbukcd not empty):
    - Execute Net Mansion variations (execEKU0061C010)

### Stage 12 - Progress Registration (when ukState = true)

39. Execute before registration (execEKK1091D010_before)
40. Execute after registration (execEKK1091D010_after)
41. If jdg_flg = "1" or isFauthori = true: execute result reflection registration (execEKK1091D010_jdg)

### Stage 13 - Application Detail Review (when ukState = true AND func_code = "1")

42. Execute application detail review (execEKK0021C060)

### Stage 14 - Service Contract Internal Details Consent (ido_div = "00017")

43. If ido_div = "00017" and ekk0251RunFlg = "1":
    - Call SC EKK0251A010 to retrieve service contract internal details consent
    - If results exist: execute internal details consent update (execEKK0251C030)

### Stage 15 - Add Yoksi (Cancellation Suppression)

44. Call addYoksi(handle, param, scCall, ccMsg, svc_list)

### Stage 16 - Discount Application (when futureFlg is empty and prcGrpCd != "99")

45. For each service contract in svc_list:
    - Get mskmNo and svcKeiNo
    - Execute discount CC call (execWrisvcAutoAply) with tranDiv = "14"

### Stage 17 - Final Processing (when func_code = "1")

46. Execute billing update (execSeikyuUpdCall)
47. If ido_div = "00001" (new contract) or "00002" (service addition):
    - Set JUDGE_UPDATE_MAP to new HashMap
    - Get outMap from JUDGE_UPDATE_MAP
    - For each service contract: call updMkmScinsprtWkCall, collect svcKeiNo
    - Set key_svc_kei_no1 through key_svc_kei_no4 in outMap
    - Instantiate JKKUpdateJudgeTranCC and call execUpdateJudge

### Stage 18 - CIC Check (when func_code != "1")

48. Call SC EKK2951A010 to retrieve standard interlock billing contract consent
49. If results exist and CIC result code is not "00": set cicChkFlg = true
50. Store cicChkFlg in ccMsg

### Stage 19 - Return

51. Return param

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle for SC invocation, DB lookups, and transaction management |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object carrying business data, control maps, and mapping work area |
| 3 | `fixedText` | `String` | Key used to retrieve ccMsg hashmap and route SC invocations |

Instance fields and external state read by the method:

| No | Field/Constant | Source | Business Description |
|----|---------------|--------|---------------------|
| 1 | `MAP_KEY_KKSV040333SC` | static final field | Map key "KKSV040333SC" for initial authorization results |
| 2 | `JUDGE_UPDATE_MAP` | instance field | Key for storing judgment update data during new contract processing |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `execEKK0011D020` | EKK0011D020SC | KK_T_MSKM (acceptance registration) | Service contract acceptance registration |
| C | `execEKK0501D010` | EKK0501D010SC | KK_T_MONEY_TRANSFER | Money transfer procedure registration |
| R | `execEKK0501C030` | EKK0501C030SC | KK_T_MONEY_TRANSFER | Money transfer review request |
| C | `execEKK0501C080` | EKK0501C080SC | KK_T_MONEY_TRANSFER | Money transfer review OK registration |
| C | `execEKK0501C090` | EKK0501C090SC | KK_T_MONEY_TRANSFER | Money transfer review NG registration |
| R | `execEKKA0010004` | EKKA0010004SC | External auth gateway | Initial credit authorization request |
| C | `execEKK0531A010` | EKK0531A010SC | KK_T_CREDIT_CARD_CONSENT | Credit card company consent |
| C | `execEKK0521A010` | EKK0521A010SC | KK_T_CREDIT_CARD | Card company consent registration |
| C | `execEKK0521D010` | EKK0521D010SC | KK_T_CREDIT_REQUEST | Credit card billing request |
| R | `execEKK0521C030` | EKK0521C030SC | KK_T_CREDIT_AUTH | Credit card review authorization request |
| C | `execEKK0521C110` | EKK0521C110SC | KK_T_CREDIT_AUTH | Credit card review OK registration |
| C | `execEKK0521C120` | EKK0521C120SC | KK_T_CREDIT_AUTH | Credit card review NG registration |
| C | `execEKK0491D010` | EKK0491D010SC | KK_T_SEIKYU_CONTRACT | Billing contract registration |
| C | `execEKK1031D010` | EKK1031D010SC | KK_T_CREDIT_INITIAL_AUTH | Credit card initial auth registration |
| C | `execEKK0321C020` | EKK0321C020SC | KK_T_CHARGE_CONTRACT | Charge contract change (service contract number generation) |
| R | `execEKK0791A010` | EKK0791A010SC | KK_T_FEE_COURSE | Fee course consent, ID notice issuance code retrieval |
| C | `execECK0151D010` | ECK0151D010SC | KK_T_SISI_NOTES | Instruction registration with service contract number generation |
| C | `execEKK0441A010` | EKK0441A010SC | KK_T_SEIOP_CONTRACT | Optional service contract consent |
| C | `execEKK0441C210` | EKK0441C210SC | KK_T_SEIOP_CONTRACT | Optional service contract cancel |
| C | `execEKK0441C230` | EKK0441C230SC | KK_T_SEIOP_CONTRACT | Optional service contract cancellation |
| C | `execEKK0441C240` | EKK0441C240SC | KK_T_SEIOP_CONTRACT | Optional service contract cancellation confirm |
| C | `execEKK0441D010` | EKK0441D010SC | KK_T_SEIOP_INVOICE | Optional service contract registration (invoice) |
| R | `execEKK0441C030` | EKK0441C030SC | KK_T_SEIOP_CONTRACT | Optional service contract review |
| C | `execEKK0441C040` | EKK0441C040SC | KK_T_SEIOP_CONTRACT | Optional service contract conclusion |
| C | `execEKK0441C070` | EKK0441C070SC | KK_T_SEIOP_CONTRACT | Optional service contract start (first billing) |
| C | `execEKK0441C060` | EKK0441C060SC | KK_T_SEIOP_CONTRACT | Optional service contract reservation application |
| R | `callSC` (EKK0251A010) | EKK0251A010SC | KK_T_SVC_KAI_NAIYO | Service contract internal details consent search |
| C | `execEKK0251C030` | EKK0251C030SC | KK_T_SVC_KAI_NAIYO | Service contract internal details consent update |
| R | `callSC` (EKK2951A010) | EKK2951A010SC | KK_T_STANDARDS_INTERLOCK | Standard interlock billing contract consent |
| C | `addYoksi` | - | - | Cancellation suppression registration mapping and execution |
| C | `execWrisvcAutoAply` | WRICVS | WRICVS_DISCOUNT | Discount auto-application (tranDiv = "14") |
| C | `execSeikyuUpdCall` | SEIKYU_UPD | KK_T_SEIKYU | Billing update (address change) |
| R | `updMkmScinsprtWkCall` | UPD_MKM | KK_T_APPLICATION | Application screen input support work update |
| C | `execUpdateJudge` | JUDGE_TRN | JUDGE_UPDATE | Judgment update transaction |
| - | `execEKU0021C010` | EKU0021C010SC | KK_T_KOJI_NET | Construction work Net Home variations |
| - | `execEKU0031C010` | EKU0031C010SC | KK_T_KOJI_TV | Construction work TV variations |
| - | `execEKU0041C010` | EKU0041C010SC | KK_T_KOJI_TV_LINE | Construction work TV line variations |
| - | `execEKU0061C010` | EKU0061C010SC | KK_T_KOJI_MANSION | Construction work Net Mansion variations |
| C | `execEKK1091D010_before` | EKK1091D010SC | - | Progress registration (before split) |
| C | `execEKK1091D010_after` | EKK1091D010SC | - | Progress registration (after split) |
| C | `execEKK1091D010_jdg` | EKK1091D010SC | - | Progress registration for result reflection screen |
| C | `execEKK0021C060` | EKK0021C060SC | KK_T_APPLICATION_DETAIL | Application detail review and follow-up work request |
| U | `editErrInfo` | - | - | Edit error information in param |
| R | `JKKSeikyKeiHenkoCC.getFauthoriSnnRsltCd` | - | - | Get approval result code from transaction result code |
| R | `JPCBPCommon.getSysDateTimeStamp` | JPCBPCommon | - | Get system date time stamp |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | BPM:KKSV0403 | KKSV0403OPOperation -> KKSV040301CC -> JKKSeikyKeiBunkatsuCC.seikyBunkatsu | Multiple SC calls across EKK0011D020, EKK0491D010, etc. |
| 2 | Screen:KKA15301 | KKA15301SFLogic -> (tranDiv check) -> JKKSeikyKeiBunkatsuCC.seikyBunkatsu | seikyBunkatsu SC endpoints |
| 3 | Screen:KKW01601 | KKW01601SFLogic -> (tranDiv check) -> JKKSeikyKeiBunkatsuCC.seikyBunkatsu | seikyBunkatsu SC endpoints |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Parameter extraction (L307-L348)

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMsg = (HashMap)param.getData(fixedText)` // Retrieve business data map |
| 2 | SET | `scCall = new ServiceComponentRequestInvoker()` // SC call instancer |
| 3 | SET | `workMap = (Map)param.getMappingWorkArea()` // Get work area |
| 4 | SET | `workMap.put("sysDateTimeStamp", JPCBPCommon.getSysDateTimeStamp())` // Set system timestamp |
| 5 | SET | `mskmNo = ""` // Application number placeholder |
| 6 | SET | `seiOpKeiState = ""` // Billing option service contract status |
| 7 | SET | `futureFlg = (String)ccMsg.get("future_flg")` // Future date judgment flag |
| 8 | SET | `shiharaiCd = (String)ccMsg.get("payway_cd")` // Payment method code |
| 9 | SET | `shinsaKekkaCd = (String)ccMsg.get("payway_pay_skekka_cd")` // Payment review result code |
| 10 | SET | `seiOpSvcKeiDslFlg = (String)ccMsg.get("seiopsvc_kei_dsl_flg")` // Billing option cancel judgment flag |
| 11 | SET | `ekk0251RunFlg = (String)ccMsg.get("ekk0251_run_flg")` // Service contract internal details execution flag |
| 12 | SET | `ido_div = (String)ccMsg.get("ido_div")` // Change division code |
| 13 | SET | `prcGrpCd = (String)ccMsg.get("prc_grp_cd")` // Price group code |
| 14 | SET | `svc_list = (ArrayList)ccMsg.get("KKSV040301CCList")` // List of service contracts |
| 15 | SET | `childMap = new HashMap()` // Child data map |

**Block 2** — [IF] Empty service list check (L352-L357)

| # | Type | Code |
|---|------|------|
| 1 | IF | `svc_list == null || svc_list.size() == 0` // Early return if no service data |
| 2 | RETURN | `return param` // Return unchanged param |

**Block 3** — [SET] Get first service contract (L359)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap = svc_list.get(0)` // First item from service list |
| 2 | SET | `stateCd = (String)childMap.get("kksv040321_svc_kei_stat_cd")` // Service contract status code |

**Block 4** — [IF] ukState determination (L364-L391)
Condition: `stateCd` (service contract status code)

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_cd = (String)childMap.get("kksv040321_svc_cd")` // Service code |
| 2 | SET | `ukState = false` // Un-accepted flag |
| 3 | IF | `"010".equals(stateCd)` // Is contract Accepted? |
| 4 | IF-INNER | `svc_cd.equals("51") || svc_cd.equals("05")` // ENUM or Electric [CD00130_05 = "05"] |
| 5 | SET-INNER | `ukState = true` // Process un-accepted ENUM/Electric |
| 6 | ELSE | `ukState = true` // Not Accepted status - always process |

**Block 5** — [IF] Acceptance registration (L397-L407)
Condition: `ukState` is true

| # | Type | Code |
|---|------|------|
| 1 | IF | `ukState` |
| 2 | CALL | `execEKK0011D020(handle, param, scCall, ccMsg, childMap)` // Acceptance registration |
| 3 | IF | `"1".equals(ccMsg.get("func_code"))` // Update mode |
| 4 | SET | `mskmNo = (String)ccMsg.get("ekk0011d020_mskm_no")` // Get application number |
| 5 | ELSE | `mskmNo = (String)childMap.get("kksv040301_mskm_no")` // Use existing application number |

**Block 6** — [IF] Mail/Money Order payment path (L412-L428)
Condition: `shiharaiCd` = "2" or "3"

| # | Type | Code |
|---|------|------|
| 1 | IF | `"2".equals(shiharaiCd) || "3".equals(shiharaiCd)` // Mail or Money Order |
| 2 | CALL | `execEKK0501D010(handle, param, scCall, ccMsg, childMap)` // Money transfer procedure |
| 3 | CALL | `execEKK0501C030(handle, param, scCall, ccMsg, childMap)` // Money transfer review request |
| 4 | IF | `"0".equals(shinsaKekkaCd)` // Payment review OK |
| 5 | CALL | `execEKK0501C080(handle, param, scCall, ccMsg, childMap)` // Register review OK |
| 6 | ELSE | `execEKK0501C090(handle, param, scCall, ccMsg, childMap)` // Register review NG |

**Block 7** — [IF] Credit Card payment path (L439-L544)
Condition: `shiharaiCd` = "4"

| # | Type | Code |
|---|------|------|
| 1 | IF | `"4".equals(shiharaiCd)` // Credit Card |
| 2 | IF | `JKKCommonUtil.isNull(shinsaKekkaCd)` // Unreviewed payment |
| 3 | IF | `JPCModelConstant.FUNC_CD_1.equals(ccMsg.get(JCMConstants.FUNC_CODE_KEY))` // Update mode |
| 4 | CALL | `execEKKA0010004(handle, param, scCall, ccMsg, childMap)` // Initial authorization |
| 5 | SET | `kksv040333sc = (HashMap)childMap.get(MAP_KEY_KKSV040333SC)` // Get auth result map |
| 6 | SET | `trnRsltCd = (String)kksv040333sc.get(EKKA0010004CBSMsg.PY_RESULTCODE)` // Transaction result |
| 7 | SET | `snnRsltCd = JKKSeikyKeiHenkoCC.getFauthoriSnnRsltCd(trnRsltCd)` // Approval result code |
| 8 | SET | `rspnsCd = (String)kksv040333sc.get(EKKA0010004CBSMsg.PY_RESPONSE_CODE)` // Response code |
| 9 | SET | `ccMsg.put("response_code", rspnsCd)` // Store response code |
| 10 | SET | `rspnsDtl = (String)kksv040333sc.get(EKKA0010004CBSMsg.PY_RESPONSE_DETAIL)` // Response detail |
| 11 | SET | `ccMsg.put("response_detail", rspnsDtl)` // Store response detail |
| 12 | SET | `ccMsg.put(MAP_KEY_KKSV040333SC, kksv040333sc)` // Store back to childMap |
| 13 | IF | `JKKSeikyKeiHenkoCC.SNN_RSLT_CD_ERR.equals(snnRsltCd)` // System error |
| 14 | SET | `ccMsg.put("err_flg", "E_AUTHORI_ERR")` // Set error flag |
| 15 | CALL | `editErrInfo(param)` // Edit error info |
| 16 | CALL | `throw new CCException("Service component error", new Exception())` // Throw exception |
| 17 | ELSE-IF | `JKKSeikyKeiHenkoCC.SNN_RSLT_CD_NG.equals(snnRsltCd)` // Authorization NG |
| 18 | SET | `ccMsg.put("err_flg", "E_AUTHORI_NG")` // Set error flag |
| 19 | CALL | `editErrInfo(param)` // Edit error info |
| 20 | CALL | `throw new CCException("Service component error", new Exception())` // Throw exception |
| 21 | SET | `ccMsg.put("prg_stat", JKKFamiilyPackConst.CD00647_0800)` // Set progress status |
| 22 | SET | `isFauthori = true` // Authorization flag set |
| 23 | CALL | `execEKK0531A010(handle, param, scCall, ccMsg, childMap)` // Credit card company consent |
| 24 | SET | `childMap.put("kksv040312_pay_skekka_cd", JKKFamiilyPackConst.CD00249_40)` // Set review code to 40 |

**Block 7.1** — [IF] func_code = "1" update mode inside credit path (L501-L543)

| # | Type | Code |
|---|------|------|
| 1 | IF | `JPCModelConstant.FUNC_CD_1.equals(ccMsg.get(JCMConstants.FUNC_CODE_KEY))` // Update mode |
| 2 | SET | `kksv040333sc = (HashMap)childMap.get(MAP_KEY_KKSV040333SC)` // Get auth map |
| 3 | SET | `crecardSbtCd = (String)kksv040333sc.get(EKKA0010004CBSMsg.PY_DEBIT_PREPAID_TYPE)` // Debit/prepaid type |
| 4 | SET | `crdtIssuerDiv = (String)kksv040333sc.get(EKKA0010004CBSMsg.PY_ISSUR_CLASS)` // Issuer division |
| 5 | IF | `JKKCommonUtil.isNull(crecardSbtCd) || JKKCommonUtil.isNull(crdtIssuerDiv)` // Card type or issuer null |
| 6 | CALL | `execEKK0521A010(handle, param, scCall, ccMsg, childMap)` // Card company consent |
| 7 | CALL | `execEKK0521D010(handle, param, scCall, ccMsg, childMap)` // Credit request |
| 8 | ELSE | `execEKK0521D010(handle, param, scCall, ccMsg, childMap)` // Credit request (else path) |

**Block 7.2** — [IF] Credit review result (L549-L559)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `execEKK0521C030(handle, param, scCall, ccMsg, childMap)` // Credit review request |
| 2 | IF | `JKKCommonUtil.isNull(shinsaKekkaCd) || "0".equals(shinsaKekkaCd)` // Unreviewed or OK |
| 3 | CALL | `execEKK0521C110(handle, param, scCall, ccMsg, childMap)` // Register credit OK |
| 4 | ELSE-IF | `"1".equals(shinsaKekkaCd)` // NG result |
| 5 | CALL | `execEKK0521C120(handle, param, scCall, ccMsg, childMap)` // Register credit NG |

**Block 8** — [CALL] Billing contract registration (L566)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `execEKK0491D010(handle, param, scCall, ccMsg, childMap)` // Billing contract registration |

**Block 9** — [IF] Credit initial auth registration (L569-L579)
Condition: shiharaiCd = "4" and shinsaKekkaCd is empty

| # | Type | Code |
|---|------|------|
| 1 | IF | `"4".equals(shiharaiCd)` // Credit Card |
| 2 | IF | `"".equals(shinsaKekkaCd)` // Review code is empty |
| 3 | IF | `JPCModelConstant.FUNC_CD_1.equals(ccMsg.get(JCMConstants.FUNC_CODE_KEY))` // Update mode |
| 4 | CALL | `execEKK1031D010(handle, param, scCall, ccMsg, childMap)` // Initial auth registration |

**Block 10** — [FOR] Charge contract changes loop (L588-L618)

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (int k = 0; k < svc_list.size(); k++)` // Loop over service contracts |
| 2 | SET | `kakinChildMap = svc_list.get(k)` // Get item |
| 3 | CALL | `execEKK0321C020(handle, param, scCall, ccMsg, kakinChildMap)` // Charge contract change |
| 4 | IF | `!"99".equals(prcGrpCd)` // Not all-price-group |
| 5 | IF | `"".equals(futureFlg) && !"010".equals(kakinChildMap.get("kksv040321_svc_kei_stat_cd"))` // Not future, not Accepted |
| 6 | CALL | `execEKK0791A010(handle, param, scCall, ccMsg, kakinChildMap)` // Fee course consent |
| 7 | IF | `!"0".equals(kakinChildMap.get("id_tchisho_hak_skbt_cd"))` // ID notice not "0" (not issued) |
| 8 | CALL | `execECK0151D010(handle, param, scCall, ccMsg, kakinChildMap)` // Instruction registration |

**Block 11** — [IF] Optional service contract cancellation (L630-L668)
Condition: `seiOpSvcKeiDslFlg` = "1"

| # | Type | Code |
|---|------|------|
| 1 | IF | `"1".equals(seiOpSvcKeiDslFlg)` // Optional service cancel flag |
| 2 | SET | `seiOpKeiState = (String)childMap.get("kksv040321_seiopsvc_kei_stat")` // Get status |
| 3 | CALL | `execEKK0441A010(handle, param, scCall, ccMsg, childMap)` // Optional service consent |
| 4 | IF | `"010".equals(seiOpKeiState) || "020".equals(seiOpKeiState)` // Accepted or Under Review |
| 5 | CALL | `execEKK0441C210(handle, param, scCall, ccMsg, childMap)` // Contract cancel |
| 6 | SET | `jikkouFlg = "1"` // Execution flag: cancel |
| 7 | ELSE | `execEKK0441C230(handle, param, scCall, ccMsg, childMap)` // Contract cancellation |
| 8 | SET | `jikkouFlg = "2"` // Execution flag: cancellation |
| 9 | IF | `"1".equals(ccMsg.get("func_code"))` // Update mode |
| 10 | CALL | `execEKK0441C240(handle, param, scCall, ccMsg, childMap)` // Cancellation confirm |

**Block 12** — [IF] Invoice generation (L688-L739)
Conditions: `yh` = "1" (invoice required) AND `svcCdFlg` = "1" (net service)

| # | Type | Code |
|---|------|------|
| 1 | SET | `yh = (String)ccMsg.get("seikyus_hakko_yh")` // Invoice issuance code |
| 2 | SET | `svcCdFlg = (String)ccMsg.get("svc_cd_flg")` // Net service flag |
| 3 | IF | `"1".equals(yh) && "1".equals(svcCdFlg)` // Invoice required and net service |
| 4 | CALL | `execEKK0441D010(handle, param, scCall, ccMsg, childMap)` // Optional service contract registration |
| 5 | IF | `iStateCd >= 20` // Review stage |
| 6 | CALL | `execEKK0441C030(handle, param, scCall, ccMsg, childMap)` // Contract review |
| 7 | IF | `iStateCd >= 30` // Conclusion stage |
| 8 | CALL | `execEKK0441C040(handle, param, scCall, ccMsg, childMap)` // Contract conclusion |
| 9 | IF | `iStateCd >= 100 && iStateCd <= 220` // First billing stage |
| 10 | SET | `seikyYm = (String)childMap.get("kksv040314_first_seiky_ym")` // First billing month |
| 11 | SET | `svcChrgYmd = (String)childMap.get("kksv040319_svc_chrg_staymd")` // Service charge start date |
| 12 | IF | `seikyYm valid && svcChrgYmd empty` // Error: missing charge date |
| 13 | SET | `ccMsg.put("err_flg", "E_CHRG")` // Set charge error |
| 14 | RETURN | `return param` // Early return |
| 15 | CALL | `execEKK0441C070(handle, param, scCall, ccMsg, childMap)` // Contract start |
| 16 | CALL | `execEKK0441C060(handle, param, scCall, ccMsg, childMap)` // Reservation application |
| 17 | SET | `jikkouFlg = "3"` // Execution flag: invoice |

**Block 13** — [IF] Payment method notification email control (L742-L746)

| # | Type | Code |
|---|------|------|
| 1 | IF | `childMap.get("kksv040331_paywaytcml_ctl_cd") != null` // Payment method email control set |
| 2 | CALL | `execEKK0491C250(handle, param, scCall, ccMsg, childMap)` // Payment notification email control |

**Block 14** — [IF] Construction work variations (L762-L799)
Condition: `kojiakNo` is not empty

| # | Type | Code |
|---|------|------|
| 1 | SET | `prcgrpcdKoji = (String)childMap.get("kksv040321_prc_grp_cd")` // Price group |
| 2 | SET | `manbukcd = (String)childMap.get("kksv040327_mansion_bukken_cd")` // Mansion project code |
| 3 | SET | `kojiakNo = (String)ccMsg.get("kojiak_no")` // Construction project number |
| 4 | IF | `!"".equals(kojiakNo)` // Construction project number exists |
| 5 | IF | `"02".equals(prcgrpcdKoji) || ("10".equals(prcgrpcdKoji) && "".equals(manbukcd))` // Net Home or Phone without mansion |
| 6 | CALL | `execEKU0021C010(handle, param, scCall, ccMsg, childMap)` // Net Home variations |
| 7 | ELSE-IF | `"11".equals(prcgrpcdKoji) || "13".equals(prcgrpcdKoji)` // TV K-CAT or TV Re-transmission |
| 8 | CALL | `execEKU0031C010(handle, param, scCall, ccMsg, childMap)` // TV variations |
| 9 | ELSE-IF | `"12".equals(prcgrpcdKoji)` // TV KCN |
| 10 | CALL | `execEKU0041C010(handle, param, scCall, ccMsg, childMap)` // TV line variations |
| 11 | ELSE-IF | `"03".equals(prcgrpcdKoji) || "04".equals(prcgrpcdKoji) || ("10".equals(prcgrpcdKoji) && !"".equals(manbukcd))` // Net Mansion, Net Mezono, or Phone with mansion |
| 12 | CALL | `execEKU0061C010(handle, param, scCall, ccMsg, childMap)` // Net Mansion variations |

**Block 15** — [IF] Progress registration (L805-L821)
Condition: `ukState` is true

| # | Type | Code |
|---|------|------|
| 1 | IF | `ukState` // Un-accepted state |
| 2 | CALL | `execEKK1091D010_before(handle, param, scCall, ccMsg, childMap)` // Progress before split |
| 3 | CALL | `execEKK1091D010_after(handle, param, scCall, ccMsg, childMap)` // Progress after split |
| 4 | SET | `jdg_flg = (String)ccMsg.get("jdg_flg")` // Judgment flag |
| 5 | IF | `"1".equals(jdg_flg) || isFauthori` // Judgment flag set or authorization performed |
| 6 | CALL | `execEKK1091D010_jdg(handle, param, scCall, ccMsg, childMap)` // Result reflection progress registration |

**Block 16** — [IF] Application detail review (L827-L831)
Condition: `ukState` is true AND `func_code` = "1"

| # | Type | Code |
|---|------|------|
| 1 | IF | `ukState && "1".equals(ccMsg.get("func_code"))` // Un-accepted and update mode |
| 2 | CALL | `execEKK0021C060(handle, param, scCall, ccMsg, childMap)` // Application detail review |

**Block 17** — [IF] Service contract internal details consent (ido_div = "00017") (L834-L850)

| # | Type | Code |
|---|------|------|
| 1 | IF | `"00017".equals(ido_div) && "1".equals(ekk0251RunFlg)` // Change division 00017 and EKK0251 flag |
| 2 | SET | `ekk0251a010IN = new CAANMsg(EKK0251A010CBSMsg.class.getName())` // Create input message |
| 3 | SET | `ekk0251a010IN.set(TEMPLATEID, TEMPLATE_ID_EKK0251A010)` // Set template ID |
| 4 | SET | `ekk0251a010IN.set(FUNC_CODE, "2")` // Set func code |
| 5 | SET | `ekk0251a010IN.set(KEY_SVC_KEI_KAISEN_UCWK_NO, childMap.get("svc_kei_kaisen_ucwk_no"))` // Set service key |
| 6 | SET | `ekk0251a010IN.set(KEY_GENE_ADD_DTM, "")` // Set generation date time |
| 7 | CALL | `parentTemplate = callSC(handle, scCall, param, fixedText, ekk0251a010IN)` // Call SC |
| 8 | SET | `templateArray = parentTemplate.getCAANMsgList(...)` // Get result array |
| 9 | IF | `templateArray != null && length > 0` // Results exist |
| 10 | CALL | `execEKK0251C030(handle, param, scCall, ccMsg, childMap, templateArray)` // Internal details update |

**Block 18** — [CALL] Add Yoksi (L854)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `addYoksi(handle, param, scCall, ccMsg, svc_list)` // Cancellation suppression registration |

**Block 19** — [FOR] Discount application loop (L879-L894)
Condition: `futureFlg` is empty AND `prcGrpCd` != "99"

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(futureFlg) && !"99".equals(prcGrpCd)` // Not future date and not all-price-group |
| 2 | FOR | `for (int k = 0; k < svc_list.size(); k++)` // Loop over service contracts |
| 3 | IF | `svc_list.size() >= 2` // Multiple contracts (from review screen) |
| 4 | SET | `mskmNo = (String)childMap.get("kksv040301_mskm_no")` // Get application number |
| 5 | SET | `wricvsChildMap = svc_list.get(k)` // Get item |
| 6 | SET | `svcKeiNo = (String)wricvsChildMap.get("kksv040321_svc_kei_no")` // Service contract number |
| 7 | CALL | `execWrisvcAutoAply(handle, param, ccMsg, mskmNo, svcKeiNo, "14", wricvsChildMap)` // Discount auto-application |

**Block 20** — [IF] Final processing (func_code = "1") (L899-L931)

| # | Type | Code |
|---|------|------|
| 1 | IF | `"1".equals(ccMsg.get("func_code"))` // Update/Confirm mode |
| 2 | CALL | `execSeikyuUpdCall(handle, param, ccMsg)` // Billing update (address change) |
| 3 | IF | `"00001".equals(ido_div) || "00002".equals(ido_div)` // New contract or service addition |
| 4 | SET | `param.setData(JUDGE_UPDATE_MAP, new HashMap())` // Initialize judgment update map |
| 5 | SET | `outMap = (HashMap)param.getData(JUDGE_UPDATE_MAP)` // Get out map |
| 6 | SET | `svcKeiList = new ArrayList<String>()` // Service contract number list |
| 7 | FOR | `for (int m = 0; m < svc_list.size(); m++)` // Loop over service contracts |
| 8 | SET | `mskmChildMap = svc_list.get(m)` // Get item |
| 9 | CALL | `scvkei = updMkmScinsprtWkCall(handle, param, ccMsg, mskmChildMap)` // Update work call |
| 10 | SET | `svcKeiList.add(scvkei)` // Add to list |
| 11 | FOR | `for (int j = 0; j < svcKeiList.size(); j++)` // Set key_svc_kei_no1-4 |
| 12 | SET | `outMap.put("key_svc_kei_no" + (j+1), svcKeiList.get(j))` |
| 13 | IF | `svcKeiList.size() == 1` // Only 1 service contract |
| 14 | SET | `outMap.put("key_svc_kei_no2", "")` etc. // Clear remaining keys |
| 15 | IF-ELSE-IF | `svcKeiList.size() == 2 / 3` // 2 or 3 contracts |
| 16 | SET | `new JKKUpdateJudgeTranCC().execUpdateJudge(handle, param, JUDGE_UPDATE_MAP)` // Judgment update |

**Block 21** — [IF] CIC check (func_code != "1") (L936-L955)

| # | Type | Code |
|---|------|------|
| 1 | SET | `cicChkFlg = false` // CIC check flag |
| 2 | IF | `!"1".equals(ccMsg.get("func_code"))` // Not update/confirm mode |
| 3 | SET | `ekk2951a010In = new CAANMsg(EKK2951A010CBSMsg.class.getName())` // Create input |
| 4 | SET | `ekk2951a010In.set(TEMPLATEID, TEMPLATE_ID_EKK2951A010)` // Set template |
| 5 | SET | `ekk2951a010In.set(FUNC_CODE, "1")` // Set func code |
| 6 | SET | `ekk2951a010In.set(KEY_SEIKY_KEI_NO, childMap.get("kksv040302_key_seiky_kei_no"))` // Set billing key |
| 7 | CALL | `ekk2951a010Out = callSC(...).getCAANMsgList(...)` // Call SC and get results |
| 8 | IF | `ekk2951a010Out != null && length > 0 && !"00".equals(cicRnkiNaiyoCd)` // Results exist and CIC not OK |
| 9 | SET | `cicChkFlg = true` // CIC check flag |
| 10 | SET | `ccMsg.put("cic_chk_flg", cicChkFlg)` // Store CIC flag |

**Block 22** — [RETURN] Return (L958)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` // Return the processed param |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `seikyBunkatsu` | Method | Billing Item Classification - central routing and dispatch method |
| `svc_kei_stat_cd` | Field | Service contract status code - "010" = Accepted, "020" = Under Review |
| `svc_cd` | Field | Service code - "51" = ENUM (fiber), "05" = Electric |
| `shiharaiCd` | Field | Payment method code - "2" = Mail, "3" = Money Order, "4" = Credit Card |
| `shinsaKekkaCd` | Field | Payment review result code - "0" = OK, "1" = NG, "40" = pending |
| `futureFlg` | Field | Future date judgment flag - empty = current date processing |
| `seiOpSvcKeiDslFlg` | Field | Billing option service cancel judgment flag - "1" = cancel present |
| `seiOpKeiState` | Field | Billing option service contract status |
| `ekk0251RunFlg` | Field | Service contract internal details execution flag |
| `ido_div` | Field | Change division code - "00001" = new contract, "00002" = service addition, "00017" = billing split |
| `prcGrpCd` | Field | Price group code - "02" = Net Home, "03" = Net Mansion, "04" = Net Mezono, "10" = Phone, "11" = TV K-CAT, "12" = TV KCN, "13" = TV Re-transmission, "99" = all-price-group |
| `ukState` | Field | Un-accepted state flag - true means contract needs processing |
| `func_code` | Field | Function code - "1" = update/confirm mode |
| `yh` | Field | Invoice issuance code - "1" = required |
| `svcCdFlg` | Field | Net service flag - "1" = net service |
| `iStateCd` | Field | Service contract status as integer (from stateCdMax) |
| `kojiakNo` | Field | Construction project number |
| `prcgrpcdKoji` | Field | Price group code for construction |
| `manbukcd` | Field | Mansion project code |
| `jikkouFlg` | Field | Execution flag - "1" = cancel, "2" = cancellation, "3" = invoice |
| `jdg_flg` | Field | Judgment flag - "1" = review result reflection needed |
| `isFauthori` | Field | Initial authorization flag - set after credit authorization |
| `cicChkFlg` | Field | CIC (credit information center) check flag |
| `childMap` | Field | Child data map containing service contract detail fields |
| `ccMsg` | Field | Central business data map carrying parameters between processing stages |
| `MAP_KEY_KKSV040333SC` | Constant | Map key "KKSV040333SC" for initial authorization results |
| `JUDGE_UPDATE_MAP` | Constant | Key for storing judgment update data |
| SOD | Acronym | Service Order Data |
| ENUM | Business term | ENUM internet - fiber-optic internet service |
| FTTH | Business term | Fiber To The Home - fiber-optic broadband |
| CIC | Acronym | Credit Information Center - third-party credit check service |
| SC | Acronym | Service Component - Fujitsu microservice layer for database operations |
| CBS | Acronym | Component Business Service - service component implementation |
| BPM | Acronym | Business Process Management - workflow execution engine |
| CC | Acronym | Common Component - shared business logic controller class |
