From 8af2ebe79209e20dc575eb18b4a435b20881b6f8 Mon Sep 17 00:00:00 2001 From: "vluk@2fi-solutions.com.hk" Date: Fri, 7 Nov 2025 19:16:29 +0800 Subject: [PATCH] no message --- .../modules/lioner/client/entity/Client.java | 120 ++++- .../lioner/client/req/UpdateClientReq.java | 101 ++++ .../lioner/client/service/ClientService.java | 10 +- .../lioner/client/web/ClientController.java | 49 +- .../lioner/pdf/service/PdfService.java | 460 ++++++++---------- 5 files changed, 476 insertions(+), 264 deletions(-) diff --git a/src/main/java/com/ffii/lioner/modules/lioner/client/entity/Client.java b/src/main/java/com/ffii/lioner/modules/lioner/client/entity/Client.java index 060ff91..f527c0e 100644 --- a/src/main/java/com/ffii/lioner/modules/lioner/client/entity/Client.java +++ b/src/main/java/com/ffii/lioner/modules/lioner/client/entity/Client.java @@ -22,6 +22,11 @@ import jakarta.validation.constraints.NotBlank; @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) public class Client extends BaseEntity{ + @Column(columnDefinition = "json") + @JdbcTypeCode(SqlTypes.JSON) + private Map others = new HashMap<>(); + + @Column private String fullname; @@ -42,6 +47,9 @@ public class Client extends BaseEntity{ @Column private String email; + @Column + private String phone1Code; + @Column private String phone1; @@ -81,12 +89,37 @@ public class Client extends BaseEntity{ @Column private String crAddressCountry; - @Column(columnDefinition = "json") - @JdbcTypeCode(SqlTypes.JSON) - private Map others = new HashMap<>(); - @Column private String crAddressPostalCode; + + @Column + private String corAddressRoom; + + @Column + private String corAddressFloor; + + @Column + private String corAddressBlock; + + @Column + private String corAddressBuilding; + + @Column + private String corAddressStreet; + + @Column + private String corAddressArea; + + @Column + private String corAddressCity; + + @Column + private String corAddressCountry; + + @Column + private String corAddressPostalCode; + + @Column private String salaryCurrent; @@ -1091,6 +1124,85 @@ public class Client extends BaseEntity{ public void setTotalFinalExpenditureLast(String totalFinalExpenditureLast) { this.totalFinalExpenditureLast = totalFinalExpenditureLast; } + + public String getCorAddressRoom() { + return corAddressRoom; + } + + public void setCorAddressRoom(String corAddressRoom) { + this.corAddressRoom = corAddressRoom; + } + + public String getCorAddressFloor() { + return corAddressFloor; + } + + public void setCorAddressFloor(String corAddressFloor) { + this.corAddressFloor = corAddressFloor; + } + + public String getCorAddressBlock() { + return corAddressBlock; + } + + public void setCorAddressBlock(String corAddressBlock) { + this.corAddressBlock = corAddressBlock; + } + + public String getCorAddressBuilding() { + return corAddressBuilding; + } + + public void setCorAddressBuilding(String corAddressBuilding) { + this.corAddressBuilding = corAddressBuilding; + } + + public String getCorAddressStreet() { + return corAddressStreet; + } + + public void setCorAddressStreet(String corAddressStreet) { + this.corAddressStreet = corAddressStreet; + } + + public String getCorAddressArea() { + return corAddressArea; + } + + public void setCorAddressArea(String corAddressArea) { + this.corAddressArea = corAddressArea; + } + + public String getCorAddressCity() { + return corAddressCity; + } + + public void setCorAddressCity(String corAddressCity) { + this.corAddressCity = corAddressCity; + } + + public String getCorAddressCountry() { + return corAddressCountry; + } + + public void setCorAddressCountry(String corAddressCountry) { + this.corAddressCountry = corAddressCountry; + } + + public String getCorAddressPostalCode() { + return corAddressPostalCode; + } + + public void setCorAddressPostalCode(String corAddressPostalCode) { + this.corAddressPostalCode = corAddressPostalCode; + } + + public String getPhone1Code() { + return phone1Code; + } + public void setPhone1Code(String phone1Code) { + this.phone1Code = phone1Code; + } } diff --git a/src/main/java/com/ffii/lioner/modules/lioner/client/req/UpdateClientReq.java b/src/main/java/com/ffii/lioner/modules/lioner/client/req/UpdateClientReq.java index ba8b396..b164945 100644 --- a/src/main/java/com/ffii/lioner/modules/lioner/client/req/UpdateClientReq.java +++ b/src/main/java/com/ffii/lioner/modules/lioner/client/req/UpdateClientReq.java @@ -23,6 +23,9 @@ public class UpdateClientReq { @Size(max = 500) String email; + @Size(max = 10) + String phone1Code; + @Size(max = 50) String phone1; @@ -55,6 +58,24 @@ public class UpdateClientReq { String crAddressPostalCode; + String corAddressRoom; + + String corAddressFloor; + + String corAddressBlock; + + String corAddressBuilding; + + String corAddressStreet; + + String corAddressArea; + + String corAddressCity; + + String corAddressCountry; + + String corAddressPostalCode; + String salaryCurrent; String salaryLast; @@ -983,5 +1004,85 @@ public class UpdateClientReq { this.totalFinalExpenditureLast = totalFinalExpenditureLast; } + public String getPhone1Code() { + return phone1Code; + } + + public void setPhone1Code(String phone1Code) { + this.phone1Code = phone1Code; + } + + public String getCorAddressRoom() { + return corAddressRoom; + } + + public void setCorAddressRoom(String corAddressRoom) { + this.corAddressRoom = corAddressRoom; + } + + public String getCorAddressFloor() { + return corAddressFloor; + } + + public void setCorAddressFloor(String corAddressFloor) { + this.corAddressFloor = corAddressFloor; + } + + public String getCorAddressBlock() { + return corAddressBlock; + } + + public void setCorAddressBlock(String corAddressBlock) { + this.corAddressBlock = corAddressBlock; + } + + public String getCorAddressBuilding() { + return corAddressBuilding; + } + + public void setCorAddressBuilding(String corAddressBuilding) { + this.corAddressBuilding = corAddressBuilding; + } + + public String getCorAddressStreet() { + return corAddressStreet; + } + + public void setCorAddressStreet(String corAddressStreet) { + this.corAddressStreet = corAddressStreet; + } + + public String getCorAddressArea() { + return corAddressArea; + } + + public void setCorAddressArea(String corAddressArea) { + this.corAddressArea = corAddressArea; + } + + public String getCorAddressCity() { + return corAddressCity; + } + + public void setCorAddressCity(String corAddressCity) { + this.corAddressCity = corAddressCity; + } + + public String getCorAddressCountry() { + return corAddressCountry; + } + + public void setCorAddressCountry(String corAddressCountry) { + this.corAddressCountry = corAddressCountry; + } + + public String getCorAddressPostalCode() { + return corAddressPostalCode; + } + + public void setCorAddressPostalCode(String corAddressPostalCode) { + this.corAddressPostalCode = corAddressPostalCode; + } + } diff --git a/src/main/java/com/ffii/lioner/modules/lioner/client/service/ClientService.java b/src/main/java/com/ffii/lioner/modules/lioner/client/service/ClientService.java index c5d99bb..3c37637 100644 --- a/src/main/java/com/ffii/lioner/modules/lioner/client/service/ClientService.java +++ b/src/main/java/com/ffii/lioner/modules/lioner/client/service/ClientService.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Service; import com.ffii.core.support.AbstractBaseEntityService; import com.ffii.core.support.JdbcDao; import com.ffii.core.utils.BeanUtils; +import com.ffii.core.utils.Params; import com.ffii.lioner.modules.common.service.AuditLogService; import com.ffii.lioner.modules.lioner.client.entity.Client; import com.ffii.lioner.modules.lioner.client.entity.ClientRepository; @@ -126,10 +127,15 @@ public class ClientService extends AbstractBaseEntityService m = Map.of( "id", instance.getId() ); + + return m; } // public void markDeleteWithAuditLog(Client instance){ diff --git a/src/main/java/com/ffii/lioner/modules/lioner/client/web/ClientController.java b/src/main/java/com/ffii/lioner/modules/lioner/client/web/ClientController.java index 399e820..3e32e83 100644 --- a/src/main/java/com/ffii/lioner/modules/lioner/client/web/ClientController.java +++ b/src/main/java/com/ffii/lioner/modules/lioner/client/web/ClientController.java @@ -2,12 +2,14 @@ package com.ffii.lioner.modules.lioner.client.web; import java.io.IOException; import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.Resource; import org.springframework.http.CacheControl; @@ -28,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController; import com.ffii.lioner.modules.lioner.client.req.UpdateClientReq; import com.ffii.lioner.modules.lioner.client.service.ClientService; +import com.ffii.lioner.modules.lioner.commonField.entity.CommonField; import aj.org.objectweb.asm.Type; @@ -37,6 +40,8 @@ import com.ffii.core.response.DataRes; import com.ffii.core.response.RecordsRes; import com.ffii.core.utils.CriteriaArgsBuilder; import com.ffii.core.utils.Params; +import com.ffii.lioner.modules.lioner.client.entity.Client; +import com.ffii.lioner.modules.lioner.commonField.service.CommonFieldService; import jakarta.servlet.http.HttpServletRequest; import jakarta.validation.Valid; @@ -45,6 +50,9 @@ import jakarta.validation.Valid; @RequestMapping("/client") public class ClientController{ + @Autowired + private CommonFieldService commonFieldService; + private final Log logger = LogFactory.getLog(getClass()); private ClientService clientService; private ExcelReportService excelReportService; @@ -65,9 +73,48 @@ public class ClientController{ @Transactional(isolation = Isolation.SERIALIZABLE, rollbackFor = Exception.class, readOnly = false) @PostMapping("/save") public Map saveOrUpdate(@RequestBody @Valid UpdateClientReq req) { - return Map.of( + logger.info("getPhone1Code:" + req.getPhone1Code()); + logger.info("getMortgagesCurrent:" + req.getMortgagesCurrent()); + Map m = Map.of( Params.DATA,clientService.saveOrUpdate(req) ); + + + Map data = ((Map)m.get("data")); + + if(data.get("id") != null){ + long clientId = (Long)data.get("id"); + Client client = clientService.find(clientId).orElse(null); + //check if commond field is null + Long commonFieldId = commonFieldService.getByClientId(clientId); + CommonField commonField = commonFieldService.find(commonFieldId).orElse(null); + + if (commonField == null) { + commonField = new CommonField(); + commonField.setClientId(clientId); + commonFieldService.save(commonField); + } + + commonField.setEmail(client.getEmail()); + commonField.getOthers().put("contactNoCode",client.getPhone1Code()); + commonField.setContactNo(client.getPhone1()); + + if(client.getDob() != null){ + String dd = client.getDob().format(DateTimeFormatter.ofPattern("dd")); + String mm = client.getDob().format(DateTimeFormatter.ofPattern("MM")); + String yyyy = client.getDob().format(DateTimeFormatter.ofPattern("yyyy")); + + commonField.setDateOfBirth(dd + "/" + mm + "/" + yyyy ); + commonField.setDdDateOfBirth(dd); + commonField.setMmDateOfBirth(mm); + commonField.setYyyyDateOfBirth(yyyy); + + } + + commonFieldService.save(commonField); + } + + return m; } @Transactional(isolation = Isolation.SERIALIZABLE, rollbackFor = Exception.class, readOnly = false) diff --git a/src/main/java/com/ffii/lioner/modules/lioner/pdf/service/PdfService.java b/src/main/java/com/ffii/lioner/modules/lioner/pdf/service/PdfService.java index 9ca0e69..3cee5a0 100644 --- a/src/main/java/com/ffii/lioner/modules/lioner/pdf/service/PdfService.java +++ b/src/main/java/com/ffii/lioner/modules/lioner/pdf/service/PdfService.java @@ -454,7 +454,7 @@ public class PdfService extends AbstractBaseEntityService d = getCountryAndPhoneNo(commonField.getContactNo()); - if(d.get("countryCode") != null) - setValueIfPresent(form, "fill_12", d.get("countryCode")); - if(d.get("phoneNo") != null) - setValueIfPresent(form, "undefined_6", d.get("phoneNo")); - - setValueIfPresent(form, "Text182", commonField.getEmail()); - - setValueIfPresent(form, "Text174", commonField.getCompanyName()); - setValueIfPresent(form, "Text173_1", commonField.getCompanyNature1()); - setValueIfPresent(form, "Text173_2", commonField.getCompanyNature2()); - setValueIfPresent(form, "fill_16_2", commonField.getOccupationTitle()); - setValueIfPresent(form, "fill_17_1", commonField.getOthers().get("companyAddress1")); - setValueIfPresent(form, "fill_17_2", commonField.getOthers().get("companyAddress2")); + setValueIfPresent(form, "fill_12", client.getPhone1Code()); + setValueIfPresent(form, "undefined_6", client.getPhone1()); + + setValueIfPresent(form, "Text182", client.getEmail()); + + setValueIfPresent(form, "Text174", commonField.getOthers().get("empCompanyName")); + setValueIfPresent(form, "Text173_1", StringUtils.trimToNull(StringUtils.trimToEmpty(StringUtils.trimToEmpty(commonField.getOthers().get("empNatureA")) + " " + StringUtils.trimToEmpty(commonField.getOthers().get("empNatureB"))))); + setValueIfPresent(form, "fill_16_2", commonField.getOthers().get("empPosition")); + setValueIfPresent(form, "fill_17_1", commonField.getOthers().get("empCompanyAddress1")); /* Page2 End */ /* Page3 Start */ //setValueIfPresent(form, "undefined_51", commonField.getContactNo()); /* Page3 End */ /* Page10 Start */ + /* setValueIfPresent(form, "Text164", commonField.getOthers().get("empCompanyName")); setValueIfPresent(form, "Text163", StringUtils.trimToNull(StringUtils.trimToEmpty(StringUtils.trimToEmpty(commonField.getOthers().get("empNatureA")) + " " + StringUtils.trimToEmpty(commonField.getOthers().get("empNatureB"))))); setValueIfPresent(form, "fill_14", commonField.getOthers().get("empPosition")); setValueIfPresent(form, "fill_15_3", commonField.getOthers().get("empCompanyAddress")); + */ /* Page10 End */ /* Page12 Start */ setValueIfPresent(form, "undefined_17ha_1", commonField.getInsuranceCompany1_1()); - setValueIfPresent(form, "undefined_17ha_2", commonField.getInsuranceCompany1_2()); - //setValueIfPresent(form, "undefined_17ha_3", commonField.getInsuranceCompany1_3()); setValueIfPresent(form, "undefined_17hk_1", commonField.getOthers().get("insuranceSumInsured1_1")); - setValueIfPresent(form, "undefined_17hk_2", commonField.getOthers().get("insuranceSumInsured1_2")); - //setValueIfPresent(form, "undefined_17hk_3", commonField.getOthers().get("insuranceSumInsured1_3")); setValueIfPresent(form, "undefined_17hl", commonField.getInsuranceYear1()); setValueIfPresent(form, "undefined_17hn_1", commonField.getInsuranceCompany2_1()); - setValueIfPresent(form, "undefined_17hn_2", commonField.getInsuranceCompany2_2()); - //setValueIfPresent(form, "undefined_17hn_3", commonField.getInsuranceCompany2_3()); setValueIfPresent(form, "undefined_17ho_1", commonField.getOthers().get("insuranceSumInsured2_1")); - setValueIfPresent(form, "undefined_17ho_2", commonField.getOthers().get("insuranceSumInsured2_2")); //setValueIfPresent(form, "undefined_17ho_3", commonField.getOthers().get("insuranceSumInsured2_3")); setValueIfPresent(form, "undefined_17hp", commonField.getInsuranceYear1()); setValueIfPresent(form, "undefined_17hr_1", commonField.getInsuranceCompany3_1()); - setValueIfPresent(form, "undefined_17hr_2", commonField.getInsuranceCompany3_2()); //setValueIfPresent(form, "undefined_17hr_3", commonField.getInsuranceCompany3_3()); setValueIfPresent(form, "undefined_17hsb_1", commonField.getOthers().get("insuranceSumInsured3_1")); - setValueIfPresent(form, "undefined_17hsb_2", commonField.getOthers().get("insuranceSumInsured3_2")); //setValueIfPresent(form, "undefined_17hsb_3", commonField.getOthers().get("insuranceSumInsured3_3")); setValueIfPresent(form, "undefined_17ht", commonField.getInsuranceYear1()); @@ -1762,15 +1731,16 @@ public class PdfService extends AbstractBaseEntityService commonField.setNameChi(fieldValue); + case "fill_chinese_name" -> commonField.setNameChi(fieldValue); case "formMedical" -> commonField.getOthers().put("formMedical", fieldValue); case "formNonMedical" -> commonField.getOthers().put("formNonMedical", fieldValue); @@ -2763,9 +2739,9 @@ public class PdfService extends AbstractBaseEntityService commonField.setMmDateOfBirth(fieldValue); case "date_yyyy" -> commonField.setYyyyDateOfBirth(fieldValue); - case "fill_phone_code" -> commonField.getOthers().put("contactNoCode", fieldValue); - case "fill_17" -> commonField.setContactNo(fieldValue); - case "fill_18" -> commonField.setEmail(fieldValue); + //case "fill_phone_code" -> commonField.getOthers().put("contactNoCode", fieldValue); + //case "fill_17" -> commonField.setContactNo(fieldValue); + //case "fill_18" -> commonField.setEmail(fieldValue); //case "fill_19" -> commonField.getOthers().put("address1", fieldValue); //case "fill_19_1" -> commonField.getOthers().put("address2", fieldValue); //case "fill_23" -> commonField.getOthers().put("crAddress1", fieldValue); @@ -2773,7 +2749,8 @@ public class PdfService extends AbstractBaseEntityService commonField.setEduPri(fieldValue); case "edu_sec" -> commonField.setEduSec(fieldValue); - case "edu_post_sec" -> commonField.setEduPostSec(fieldValue); + //case "edu_post_sec" -> commonField.setEduPostSec(fieldValue); + case "edu_post_sec" -> commonField.setEduUni(fieldValue); /* Page1 End */ /* Page2 Start */ case "salary" -> commonField.setFna_c3b_salary(fieldValue); @@ -2880,8 +2857,6 @@ public class PdfService extends AbstractBaseEntityService commonField.setInsuranceCompany1_1(fieldValue); - case "fill_11_7_1" -> commonField.setInsuranceCompany1_2(fieldValue); - //case "fill_11_7_2" -> commonField.setInsuranceCompany1_3(fieldValue); case "fill_12_7_1" -> { commonField.getOthers().put("insuranceSumInsured1_1", fieldValue); @@ -2889,20 +2864,6 @@ public class PdfService extends AbstractBaseEntityService { - commonField.getOthers().put("insuranceSumInsured1_2", fieldValue); - - if(commonField.getOthers().get("insuranceSumInsured1_2") != null && !commonField.getOthers().get("insuranceSumInsured1_2").isBlank()){ - commonField.setInsuranceCurrency1("USD"); - } - } - case "fill_12_7_3" -> { - commonField.getOthers().put("insuranceSumInsured1_3", fieldValue); - - if(commonField.getOthers().get("insuranceSumInsured1_3") != null && !commonField.getOthers().get("insuranceSumInsured1_3").isBlank()){ - commonField.setInsuranceCurrency1("USD"); - } - } case "toggle_3_5" -> commonField.setInsuranceLife1(fieldValue); case "toggle_4_4" -> commonField.setInsuranceSaving1(fieldValue); case "toggle_5_5" -> commonField.setInsuranceCritical1(fieldValue); @@ -2911,8 +2872,6 @@ public class PdfService extends AbstractBaseEntityService commonField.setInsuranceYear1(fieldValue); case "fill_13_7" -> commonField.setInsuranceCompany2_1(fieldValue); - case "fill_13_7_1" -> commonField.setInsuranceCompany2_2(fieldValue); - //case "fill_13_7_2" -> commonField.setInsuranceCompany2_3(fieldValue); case "fill_14_7_1" -> { commonField.getOthers().put("insuranceSumInsured2_1", fieldValue); @@ -2920,20 +2879,6 @@ public class PdfService extends AbstractBaseEntityService { - commonField.getOthers().put("insuranceSumInsured2_2", fieldValue); - - if(commonField.getOthers().get("insuranceSumInsured2_2") != null && !commonField.getOthers().get("insuranceSumInsured2_2").isBlank()){ - commonField.setInsuranceCurrency2("USD"); - } - } - case "fill_14_7_3" -> { - commonField.getOthers().put("insuranceSumInsured2_3", fieldValue); - - if(commonField.getOthers().get("insuranceSumInsured2_3") != null && !commonField.getOthers().get("insuranceSumInsured2_3").isBlank()){ - commonField.setInsuranceCurrency2("USD"); - } - } case "toggle_9_3" -> commonField.setInsuranceLife2(fieldValue); case "toggle_10_3" -> commonField.setInsuranceSaving2(fieldValue); case "toggle_11_3" -> commonField.setInsuranceCritical2(fieldValue); @@ -2943,8 +2888,6 @@ public class PdfService extends AbstractBaseEntityService commonField.setInsuranceCompany3_1(fieldValue); - case "fill_15_7_1" -> commonField.setInsuranceCompany3_2(fieldValue); - //case "fill_15_7_2" -> commonField.setInsuranceCompany3_3(fieldValue); case "fill_16_7_1" -> { commonField.getOthers().put("insuranceSumInsured3_1", fieldValue); @@ -2952,20 +2895,6 @@ public class PdfService extends AbstractBaseEntityService { - commonField.getOthers().put("insuranceSumInsured3_2", fieldValue); - - if(commonField.getOthers().get("insuranceSumInsured3_2") != null && !commonField.getOthers().get("insuranceSumInsured3_2").isBlank()){ - commonField.setInsuranceCurrency3("USD"); - } - } - case "fill_16_7_3" -> { - commonField.getOthers().put("insuranceSumInsured2_3", fieldValue); - - if(commonField.getOthers().get("insuranceSumInsured3_3") != null && !commonField.getOthers().get("insuranceSumInsured3_3").isBlank()){ - commonField.setInsuranceCurrency3("USD"); - } - } case "toggle_15" -> commonField.setInsuranceLife3(fieldValue); case "toggle_16_2" -> commonField.setInsuranceSaving3(fieldValue); case "toggle_17_3" -> commonField.setInsuranceCritical3(fieldValue); @@ -2975,6 +2904,10 @@ public class PdfService extends AbstractBaseEntityService commonField.setUltimateTotalLife(fieldValue); + + case "ch_apply_other_insurance_yes" -> commonField.getOthers().put("appyOtherInsuranceYes", fieldValue); + case "ch_apply_other_insurance_no" -> commonField.getOthers().put("appyOtherInsuranceNo", fieldValue); + case "declinedYes" -> commonField.setDeclinedYes(fieldValue); case "declinedNo" -> commonField.setDeclinedNo(fieldValue); case "declinedDesc" -> commonField.setDeclinedDesc(fieldValue); @@ -3014,36 +2947,6 @@ public class PdfService extends AbstractBaseEntityService commonField.setFna_c2a_amount(fieldValue); case "totalLiquidLia" -> commonField.setFna_c2b_amount(fieldValue); - case "incomeSalary" -> commonField.setIncomeSalary(fieldValue); - case "incomeSalaryLastYear" -> commonField.setIncomeSalaryLastYear(fieldValue); - case "incomeBonus" -> commonField.setIncomeBonus(fieldValue); - case "incomeBonusLastYear" -> commonField.setIncomeBonusLastYear(fieldValue); - - case "earned_income_other" -> commonField.getOthers().put("incomeOtherDesc", fieldValue); - case "incomeOther" -> commonField.setIncomeOther(fieldValue); - case "incomeOtherLastYear" -> commonField.setIncomeOtherLastYear(fieldValue); - case "incomeInterest" -> commonField.setIncomeInterest(fieldValue); - case "incomeInterestLastYear" -> commonField.setIncomeInterestLastYear(fieldValue); - case "incomeDividents" -> commonField.setIncomeDividents(fieldValue); - case "incomeDividentsLastYear" -> commonField.setIncomeDividentsLastYear(fieldValue); - case "incomeRentals" -> commonField.setIncomeRentals(fieldValue); - case "incomeRentalsLastYear" -> commonField.setIncomeRentalsLastYear(fieldValue); - - case "unearned_income_other" -> commonField.getOthers().put("incomeUnearnedOtherDesc", fieldValue); - case "fill_24_4" -> commonField.getOthers().put("incomeUnearnedOther", fieldValue); - case "fill_25_4" -> commonField.getOthers().put("incomeUnearnedOtherLastYear", fieldValue); - - case "assetCash" -> commonField.setAssetCash(fieldValue); - case "assetInvestment" -> commonField.setAssetInvestment(fieldValue); - case "assetRealEstate" -> commonField.setAssetRealEstate(fieldValue); - case "assetNetBusinessInterest" -> commonField.setAssetNetBusinessInterest(fieldValue); - case "assetProperties" -> commonField.setAssetProperties(fieldValue); - case "liaLoan" -> commonField.setLiaLoan(fieldValue); - case "liaMargin" -> commonField.setLiaMargin(fieldValue); - case "liaLoanGurantee" -> commonField.setLiaLoanGurantee(fieldValue); - case "liaMortgage" -> commonField.setLiaMortgage(fieldValue); - case "liaOther" -> commonField.setLiaOther(fieldValue); - case "fill_30_4" -> commonField.getOthers().put("realEstateAddress1_1", fieldValue); case "fill_30_4_1" -> commonField.getOthers().put("realEstateAddress1_2", fieldValue); case "fill_35_2" -> commonField.getOthers().put("realEstateAddress2_1", fieldValue); @@ -3078,6 +2981,9 @@ public class PdfService extends AbstractBaseEntityService commonField.setFna_c3c_yes(fieldValue); + case "toggle_13_3" -> commonField.setFna_c3c_no(fieldValue); + } /* Special logic Start */ @@ -3101,9 +3007,9 @@ public class PdfService extends AbstractBaseEntityService commonField.setDateOfBirth(fieldValue); + //case "fna_a_birth" -> commonField.setDateOfBirth(fieldValue); case "fna_a_id_card" -> commonField.setIdCard(fieldValue); - case "fna_a_occupation" -> commonField.setOccupationTitle(fieldValue); + //case "fna_a_occupation" -> commonField.setOccupationTitle(fieldValue); case "fna_a_life_0" -> commonField.setFna_a_life_0(fieldValue); case "fna_a_life_less_5" -> commonField.setFna_a_life_less_5(fieldValue); @@ -3248,8 +3154,8 @@ public class PdfService extends AbstractBaseEntityService commonField.setNameChi(fieldValue); - case "fill_5" -> commonField.setGender(fieldValue); - case "fill_6" -> commonField.setDateOfBirth(fieldValue); + //case "fill_5" -> commonField.setGender(fieldValue); + //case "fill_6" -> commonField.setDateOfBirth(fieldValue); case "fill_7" -> commonField.setMaritalStatus(fieldValue); case "fill_8" -> commonField.setNoOfDependents(fieldValue); @@ -3361,10 +3267,11 @@ public class PdfService extends AbstractBaseEntityService commonField.setGenderMale(fieldValue); case "female" -> commonField.setGenderFemale(fieldValue); - case "DD1" -> commonField.setDdDateOfBirth(fieldValue); - case "MM1" -> commonField.setMmDateOfBirth(fieldValue); - case "YYYY1" -> commonField.setYyyyDateOfBirth(fieldValue); + //case "DD1" -> commonField.setDdDateOfBirth(fieldValue); + //case "MM1" -> commonField.setMmDateOfBirth(fieldValue); + //case "YYYY1" -> commonField.setYyyyDateOfBirth(fieldValue); + /* case "hk" -> { if("Yes".equals(fieldValue)) commonField.setPlaceOfBirth("Hong Kong"); @@ -3373,23 +3280,27 @@ public class PdfService extends AbstractBaseEntityService commonField.setPlaceOfBirth(fieldValue); case "Field_LocationB1" -> commonField.setPlaceOfBirth(fieldValue); - case "ID1" -> commonField.setIdCard(fieldValue); + //case "ID1" -> commonField.setIdCard(fieldValue); + /* case "Nationality1" -> commonField.setCountryOfCitizenship(fieldValue); case "Company1" -> commonField.setCompanyName(fieldValue); case "BusinessNature1" -> commonField.setCompanyNature1(fieldValue); case "BusinessNature2" -> commonField.setCompanyNature2(fieldValue); case "Occupation1" -> commonField.setOccupation(fieldValue); case "JobNature1" -> commonField.setOccupationTitle(fieldValue); + */ //Income1 = IDA commonField.getIncomeSalary() + commonField.getIncomeBonus() ??? beware of it may have , and english P.A. or even USD case "Checkbox_Y" -> commonField.setTobarccoYes(fieldValue); case "Checkbox_N" -> commonField.setTobarccoNo(fieldValue); /* Page1 End */ /* Page2 Start */ + /* case "Room3" -> commonField.getOthers().put("corAddressRoom", fieldValue); case "Floor3" -> commonField.getOthers().put("corAddressFloor", fieldValue); case "Block3" -> commonField.getOthers().put("corAddressBlock", fieldValue); @@ -3402,6 +3313,7 @@ public class PdfService extends AbstractBaseEntityService commonField.setContactNo(fieldValue); case "Email" -> commonField.setEmail(fieldValue); + */ /* Page2 End */ /* Page3 Start */ case "Checkbox_Wealth1" -> commonField.getOthers().put("sourceIncome", fieldValue); @@ -3521,17 +3433,19 @@ public class PdfService extends AbstractBaseEntityService commonField.setDateOfBirth(fieldValue); - case "occupation" -> commonField.setOccupationTitle(fieldValue); + //case "date_of_birth" -> commonField.setDateOfBirth(fieldValue); + //case "occupation" -> commonField.setOccupationTitle(fieldValue); //case "address1" -> commonField.getOthers().put("address1", fieldValue); //case "address2" -> commonField.getOthers().put("address2", fieldValue); - case "contact" -> commonField.setContactNo(fieldValue); - case "email" -> commonField.setEmail(fieldValue); + //case "contact" -> commonField.setContactNo(fieldValue); + //case "email" -> commonField.setEmail(fieldValue); - case "chh1" -> commonField.setEduPri(fieldValue); + /* case "chh1" -> commonField.setEduPri(fieldValue); case "chh2" -> commonField.setEduSec(fieldValue); case "chh3" -> commonField.setEduPostSec(fieldValue); case "chh4" -> commonField.setEduPostSec(fieldValue); //duplicate now + */ + case "chh5" -> commonField.setFna_a_life_0(fieldValue); case "chh6" -> commonField.setFna_a_life_less_5(fieldValue); @@ -3656,22 +3570,25 @@ public class PdfService extends AbstractBaseEntityService commonField.setGenderMale(fieldValue); case "ch1_4_f" -> commonField.setGenderFemale(fieldValue); - case "1_6_dd" -> commonField.setDdDateOfBirth(fieldValue); - case "1_6_mm" -> commonField.setMmDateOfBirth(fieldValue); - case "1_6_yyyy" -> commonField.setYyyyDateOfBirth(fieldValue); + //case "1_6_dd" -> commonField.setDdDateOfBirth(fieldValue); + //case "1_6_mm" -> commonField.setMmDateOfBirth(fieldValue); + //case "1_6_yyyy" -> commonField.setYyyyDateOfBirth(fieldValue); - case "1_7_country" -> commonField.setPlaceOfBirth(fieldValue); - case "1_8" -> commonField.setCountryOfCitizenship(fieldValue); + //case "1_7_country" -> commonField.setPlaceOfBirth(fieldValue); + //case "1_8" -> commonField.setCountryOfCitizenship(fieldValue); //if set countryOfIssue = HK //tick th 1_10_2 if have value + /* case "1_10_id_num" -> { commonField.setIdCard(fieldValue); commonField.setCountryOfIssue("HK"); } + */ //case "1_10_passport_num" -> commonField.setPassportNo(fieldValue); + /* case "1_12_1" -> commonField.setOccupation(fieldValue); case "1_12_2" -> commonField.setOccupationTitle(fieldValue); @@ -3696,7 +3613,7 @@ public class PdfService extends AbstractBaseEntityService commonField.getOthers().put("corAddressNt", fieldValue); case "1_13_tel_mobile" -> commonField.setContactNo(fieldValue); - + */ case "1_14d_tax1" -> commonField.setTaxResidency1(fieldValue); case "1_14d_tax_num1" -> commonField.setTaxPin1(fieldValue); //case "ch1_14d_reason1_a" -> commonField.setTaxReason1("A"); @@ -3893,6 +3810,7 @@ public class PdfService extends AbstractBaseEntityService commonField.setNameChi(fieldValue); + /* case "Text1" -> commonField.setIdCard(fieldValue); case "passportNo" -> commonField.setPassportNo(fieldValue); case "Text12" -> commonField.setCountryOfIssue(fieldValue); @@ -3902,6 +3820,8 @@ public class PdfService extends AbstractBaseEntityService commonField.setCountryOfCitizenship(fieldValue); case "fill_20" -> commonField.setPlaceOfBirth(fieldValue); + */ + /* Page1 End */ /* Page2 Start */ //case "Text16_1" -> commonField.getOthers().put("crAddress1", fieldValue); @@ -3912,7 +3832,7 @@ public class PdfService extends AbstractBaseEntityService commonField.setContactNo(fieldValue); - case "Text182" -> commonField.setEmail(fieldValue); + //case "Text182" -> commonField.setEmail(fieldValue); case "Check Box175" -> commonField.setEmployedSelf(fieldValue); case "Check Box177" -> commonField.setEmployed(fieldValue); case "Check Box179" -> commonField.setPartTime(fieldValue); @@ -3921,12 +3841,15 @@ public class PdfService extends AbstractBaseEntityService commonField.setHomemaker(fieldValue); case "Check Box180" -> commonField.setRetired(fieldValue); + /* case "Text174" -> commonField.setCompanyName(fieldValue); case "Text173_1" -> commonField.setCompanyNature1(fieldValue); case "Text173_2" -> commonField.setCompanyNature2(fieldValue); case "fill_16_2" -> commonField.setOccupationTitle(fieldValue); case "fill_17_1" -> commonField.getOthers().put("companyAddress1", fieldValue); case "fill_17_2" -> commonField.getOthers().put("companyAddress2", fieldValue); + */ + /* Page2 End */ /* Page3 Start */ //case "undefined_51" -> commonField.setContactNo(fieldValue); @@ -4037,13 +3960,10 @@ public class PdfService extends AbstractBaseEntityService commonField.setTobarccoYes(fieldValue); case "ch1_5s" -> commonField.setTobarccoNo(fieldValue); - case "1_6dd" -> commonField.setDdDateOfBirth(fieldValue); - case "1_6mm" -> commonField.setMmDateOfBirth(fieldValue); - case "1_6yyyy" -> commonField.setYyyyDateOfBirth(fieldValue); - - case "1_7" -> commonField.setPlaceOfBirth(fieldValue); - case "1_8" -> commonField.setCountryOfCitizenship(fieldValue); + //case "1_7" -> commonField.setPlaceOfBirth(fieldValue); + //case "1_8" -> commonField.setCountryOfCitizenship(fieldValue); + /* case "1_10id" -> { commonField.setIdCard(fieldValue); commonField.setPlaceOfBirth("Hong Kong"); @@ -4051,7 +3971,9 @@ public class PdfService extends AbstractBaseEntityService { commonField.setPassportNo(fieldValue); } + case "fill_14_date" -> commonField.getOthers().put("passportExpiryDate", fieldValue); + */ /* Page1 End */ /* Page2 Start */ case "ch1_12_self" -> commonField.setEmployedSelf(fieldValue); @@ -4061,26 +3983,16 @@ public class PdfService extends AbstractBaseEntityService commonField.setHomemaker(fieldValue); case "ch1_12_retired" -> commonField.setRetired(fieldValue); - case "1_12_occupation" -> commonField.setOccupation(fieldValue); - case "1_12_exact_duty" -> commonField.setOccupationTitle(fieldValue); + //case "1_12_occupation" -> commonField.setOccupation(fieldValue); + //case "1_12_exact_duty" -> commonField.setOccupationTitle(fieldValue); - case "1_12_employer" -> commonField.setCompanyName(fieldValue); - case "1_12_employer_address_1" -> commonField.getOthers().put("companyAddress1", fieldValue); - case "1_12_employer_address_2" -> commonField.getOthers().put("companyAddress2", fieldValue); + //case "1_12_employer" -> commonField.setCompanyName(fieldValue); + //case "1_12_employer_address_1" -> commonField.getOthers().put("companyAddress1", fieldValue); + //case "1_12_employer_address_2" -> commonField.getOthers().put("companyAddress2", fieldValue); - case "1_12_nature_1" -> commonField.setCompanyNature1(fieldValue); - case "1_12_nature_2" -> commonField.setCompanyNature2(fieldValue); + //case "1_12_nature_1" -> commonField.setCompanyNature1(fieldValue); + //case "1_12_nature_2" -> commonField.setCompanyNature2(fieldValue); - case "1_13bc_rm" -> commonField.getOthers().put("corAddressRoom", fieldValue); - case "1_13bc_floor" -> commonField.getOthers().put("corAddressFloor", fieldValue); - case "1_13bc_block" -> commonField.getOthers().put("corAddressBlock", fieldValue); - case "1_13bc_building" -> commonField.getOthers().put("corAddressBuilding", fieldValue); - case "1_13bc_street" -> commonField.getOthers().put("corAddressStreet", fieldValue); - case "1_13bc_district" -> commonField.getOthers().put("corAddressCountry", fieldValue); - case "1_13bc_zip" -> commonField.getOthers().put("corAddressPostalCode", fieldValue); - case "ch1_13bc_hk" -> commonField.getOthers().put("corAddressHK", fieldValue); - case "ch1_13bc_kln" -> commonField.getOthers().put("corAddressKln", fieldValue); - case "ch1_13bc_nt" -> commonField.getOthers().put("corAddressNt", fieldValue); /* Page2 End */ /* Page3 Start */ //case "1_13b_tel_mobile_code" -> commonField.setContactNo(fieldValue); @@ -4659,4 +4571,38 @@ public class PdfService extends AbstractBaseEntityService