瀏覽代碼

no message

master
[email protected] 1 月之前
父節點
當前提交
8af2ebe792
共有 5 個文件被更改,包括 476 次插入264 次删除
  1. +116
    -4
      src/main/java/com/ffii/lioner/modules/lioner/client/entity/Client.java
  2. +101
    -0
      src/main/java/com/ffii/lioner/modules/lioner/client/req/UpdateClientReq.java
  3. +8
    -2
      src/main/java/com/ffii/lioner/modules/lioner/client/service/ClientService.java
  4. +48
    -1
      src/main/java/com/ffii/lioner/modules/lioner/client/web/ClientController.java
  5. +203
    -257
      src/main/java/com/ffii/lioner/modules/lioner/pdf/service/PdfService.java

+ 116
- 4
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<Long>{

@Column(columnDefinition = "json")
@JdbcTypeCode(SqlTypes.JSON)
private Map<String, String> others = new HashMap<>();


@Column
private String fullname;
@@ -42,6 +47,9 @@ public class Client extends BaseEntity<Long>{
@Column
private String email;
@Column
private String phone1Code;

@Column
private String phone1;
@@ -81,12 +89,37 @@ public class Client extends BaseEntity<Long>{
@Column
private String crAddressCountry;

@Column(columnDefinition = "json")
@JdbcTypeCode(SqlTypes.JSON)
private Map<String, String> 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<Long>{
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;
}
}


+ 101
- 0
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;
}


}

+ 8
- 2
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<Client, Long, Clien
BeanUtils.copyProperties(req,instance);

instance = save(instance);
return Map.of(

logger.info("instance.getMortgagesCurrent():" + instance.getMortgagesCurrent());
logger.info("instance.getPhone1Code():" + instance.getPhone1Code());

Map<String, Object> m = Map.of(
"id", instance.getId()
);
return m;
}

// public void markDeleteWithAuditLog(Client instance){


+ 48
- 1
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<String, Object> saveOrUpdate(@RequestBody @Valid UpdateClientReq req) {
return Map.of(
logger.info("getPhone1Code:" + req.getPhone1Code());
logger.info("getMortgagesCurrent:" + req.getMortgagesCurrent());
Map<String, Object> m = Map.of(
Params.DATA,clientService.saveOrUpdate(req)
);


Map<String, Object> 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)


+ 203
- 257
src/main/java/com/ffii/lioner/modules/lioner/pdf/service/PdfService.java 查看文件

@@ -454,7 +454,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "fill_6", StringUtils.trimToEmpty(client.getLastname()));
setValueIfPresent(form, "fill_7", StringUtils.trimToEmpty(client.getFirstname()));
setValueIfPresent(form, "fill_7", commonField.getNameChi());
setValueIfPresent(form, "fill_chinese_name", commonField.getNameChi());
setValueIfPresent(form, "fill_11", commonField.getIdCard());
setValueIfPresent(form, "fill_12", commonField.getCountryOfIssue());
setValueIfPresent(form, "fill_13", commonField.getPassportNo());
@@ -467,12 +467,13 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "date_mm", commonField.getMmDateOfBirth());
setValueIfPresent(form, "date_yyyy", commonField.getYyyyDateOfBirth());
setValueIfPresent(form, "fill_17", commonField.getContactNo());
setValueIfPresent(form, "fill_18", commonField.getEmail());
setValueIfPresent(form, "fill_phone_code", client.getPhone1Code());
setValueIfPresent(form, "fill_17", client.getPhone1());
setValueIfPresent(form, "fill_18", client.getEmail());
setValueIfPresent(form, "fill_19", getCrAddress1(client));
setValueIfPresent(form, "fill_19_1", getCrAddress2(client));
//setValueIfPresent(form, "fill_23", commonField.getOthers().get("crAddress1"));
//setValueIfPresent(form, "fill_23_1", commonField.getOthers().get("crAddress2"));
setValueIfPresent(form, "fill_23", getCorAddress1(client));
setValueIfPresent(form, "fill_23_1", getCorAddress2(client));
/* Page1 End */
/* Page2 Start */
@@ -483,7 +484,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "others_funds_desc", commonField.getOthers_funds_desc());
/* Page2 End */
/* Page3 Start */
setValueIfPresent(form, "fill_18_1", commonField.getBankruptNo());
setValueIfPresent(form, "fill_18_1", commonField.getBankruptDesc());

setValueIfPresent(form, "fill_3_3", commonField.getOthers().get("travelCity1"));
setValueIfPresent(form, "fill_6_3", commonField.getOthers().get("travelCity2"));
@@ -676,7 +677,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "liaMortgageLast", formatNum(client.getMortgagesLast()));
setValueIfPresent(form, "liaMargin", formatNum(client.getMarginAccountCurrent()));
setValueIfPresent(form, "liaMarginLast", formatNum(client.getMarginAccountLast()));
setValueIfPresent(form, "liaLoanGurantee", formatNum(client.getLoanGuaranteesCurrent()));
setValueIfPresent(form, "liaLoanGuarantee", formatNum(client.getLoanGuaranteesCurrent()));
setValueIfPresent(form, "liaLoanGuaranteeLast", formatNum(client.getLoanGuaranteesLast()));
setValueIfPresent(form, "liaBankingFacility", formatNum(client.getBankingFacilityCurrent()));
setValueIfPresent(form, "liaBankingFacilityLast", formatNum(client.getBankingFacilityLast()));
@@ -712,8 +713,8 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form2, "others_funds", commonField.getOthers_funds());
setValueIfPresent(form2, "others_funds_desc", commonField.getOthers_funds_desc());
/* Page3 Start */
setValueIfPresent(form2, "toggle_3_2", commonField.getBankruptYes());
setValueIfPresent(form2, "toggle_4_2", commonField.getBankruptNo());
setValueIfPresent(form2, "toggle_5_2", commonField.getBankruptYes());
setValueIfPresent(form2, "toggle_6_2", commonField.getBankruptNo());
/* Page3 End */
/* Page5 Start */
setValueIfPresent(form2, "toggle_3_4", commonField.getOthers().get("pendingChargeYes"));
@@ -759,7 +760,6 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
/* Page 8 End */
logger.info("12");
/* Page10 Start */
setValueIfPresent(form2, "fill_41_2", commonField.getOthers().get("sourceIncome"));
setValueIfPresent(form2, "toggle_3_7", commonField.getOthers().get("sourceIncome"));
setValueIfPresent(form2, "toggle_4_6", commonField.getOthers().get("sourceBusiness"));
setValueIfPresent(form2, "toggle_6_5", commonField.getOthers().get("sourceInvestment"));
@@ -783,7 +783,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
//setValueIfPresent(form, "fna_a_name_2", commonField.getOthers().get("name2"));
setValueIfPresent(form, "fna_a_birth", commonField.getDateOfBirth());
setValueIfPresent(form, "fna_a_id_card", commonField.getIdCard());
setValueIfPresent(form, "fna_a_occupation", commonField.getOccupationTitle());
setValueIfPresent(form, "fna_a_occupation", commonField.getOthers().get("empPosition"));
setValueIfPresent(form, "fna_a_primary", commonField.getEduPri());
setValueIfPresent(form, "fna_a_secondary", commonField.getEduSec());
setValueIfPresent(form, "fna_a_tertiary", commonField.getEduPostSec());
@@ -796,11 +796,11 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "fna_a_marital", commonField.getOthers().get("maritalStatusOtherDesc"));
}
setValueIfPresent(form, "fna_a_contact", commonField.getContactNo());
setValueIfPresent(form, "fna_a_contact", StringUtils.trimToEmpty(client.getPhone1Code()) + " " + StringUtils.trimToEmpty(client.getPhone1()));
setValueIfPresent(form, "fna_a_dependents", commonField.getNoOfDependents());

setValueIfPresent(form, "fna_c1a_amount", commonField.getTotalAnnualIncome());
setValueIfPresent(form, "fna_c1b_amount", commonField.getFna_c1b_amount());
setValueIfPresent(form, "fna_c1a_amount", formatNum(client.getTotalIncomeCurrent()));
setValueIfPresent(form, "fna_c1b_amount", formatNum(client.getTotalExpenditureCurrent()));
setValueIfPresent(form, "fna_c1c_1_amount", commonField.getFna_c1c_1_amount());
setValueIfPresent(form, "fna_c1c_2_amount", commonField.getFna_c1c_2_amount());
setValueIfPresent(form, "fna_c1c_3_amount", commonField.getFna_c1c_3_amount());
@@ -809,7 +809,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito

setValueIfPresent(form, "fna_c2b_amount", commonField.getFna_c2b_amount());
setValueIfPresent(form, "fna_c2c_amount", commonField.getFna_c2c_amount());
setValueIfPresent(form, "fna_c2d_amount", commonField.getFna_c2d_amount());
setValueIfPresent(form, "fna_c2d_amount", formatNum(client.getPrincipalCurrent()));
setValueIfPresent(form, "fna_c2e_amount", commonField.getFna_c2e_amount());
setValueIfPresent(form, "fna_b1_a", commonField.getFna_b1_a());
setValueIfPresent(form, "fna_b1_a_amount", commonField.getFna_b1_a_amount());
@@ -945,6 +945,9 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form2, "fna_c3b_investments", commonField.getFna_c3b_investments());
setValueIfPresent(form2, "fna_c3b_policy", commonField.getFna_c3b_policy());
setValueIfPresent(form2, "fna_c3b_others", commonField.getFna_c3b_others());
setValueIfPresent(form2, "fna_c3c_yes", commonField.getFna_c3c_yes());
setValueIfPresent(form2, "fna_c3c_no", commonField.getFna_c3c_no());

setValueIfPresent(form2, "fna_d_1", commonField.getFna_d_1());
setValueIfPresent(form2, "fna_d_2", commonField.getFna_d_2());
@@ -962,11 +965,11 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "fill_4", commonField.getNameChi());
setValueIfPresent(form, "fill_5", commonField.getGender());
setValueIfPresent(form, "fill_6", commonField.getDateOfBirth());
setValueIfPresent(form, "fill_9", commonField.getOccupationTitle());
setValueIfPresent(form, "fill_9", commonField.getOthers().get("empPosition"));

setValueIfPresent(form, "fill_7", commonField.getMaritalStatus());
setValueIfPresent(form, "fill_8", commonField.getNoOfDependents());
setValueIfPresent(form, "fill_10", commonField.getContactNo());;
setValueIfPresent(form, "fill_10", client.getPhone1Code() + " " + client.getPhone1());;
if(StringUtils.isNotEmpty(commonField.getTotalAnnualIncome())){
setValueIfPresent(form, "fill_11", commonField.getTotalAnnualIncome() ); //annual
@@ -1190,15 +1193,16 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito

private void SLFNA_EN_textBox(PdfAcroForm form, CommonField commonField, Client client){
/* Page1 Start */
setValueIfPresent(form, "name", StringUtils.trimToEmpty(StringUtils.trimToEmpty(client.getLastname()) + " " + StringUtils.trimToEmpty(client.getFirstname())));
setValueIfPresent(form, "date_of_birth", commonField.getDateOfBirth());
setValueIfPresent(form, "address1", getCrAddress1(client));
//setValueIfPresent(form, "name", StringUtils.trimToEmpty(StringUtils.trimToEmpty(client.getLastname()) + " " + StringUtils.trimToEmpty(client.getFirstname())));
//setValueIfPresent(form, "date_of_birth", commonField.getDateOfBirth());
/*setValueIfPresent(form, "address1", getCrAddress1(client));
setValueIfPresent(form, "address2", getCrAddress2(client));
setValueIfPresent(form, "contact", commonField.getContactNo());
setValueIfPresent(form, "email", commonField.getEmail());
setValueIfPresent(form, "occupation", commonField.getOccupationTitle());

*/
setValueIfPresent(form, "1amount", commonField.getFna_b1_d_amount());
setValueIfPresent(form, "cb1f", commonField.getFna_b1_f_other());

@@ -1253,31 +1257,6 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito

/* Page4 End */

/* special fields start */

//age
if(StringUtil.isNotEmpty(commonField.getDateOfBirth())){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");

try {
// Parse the string into a LocalDate object
LocalDate dob = LocalDate.parse(commonField.getDateOfBirth(), formatter);

// Get the current date
LocalDate currentDate = LocalDate.now();

// Calculate the period between the two dates
Period period = Period.between(dob, currentDate);

setValueIfPresent(form, "age", String.valueOf(period.getYears()));

} catch (DateTimeParseException e) {
System.err.println("Error parsing date. Please ensure the format is dd/MM/yyyy.");
}
}
/* special fields end */

if(client != null && client.getConsultantId() != null){
Consultant consultant = consultantService.find(Long.valueOf(client.getConsultantId())).orElseThrow();

@@ -1437,27 +1416,29 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "ch1_13_block", client.getCrAddressBlock());
setValueIfPresent(form, "ch1_13_building", client.getCrAddressBuilding());
setValueIfPresent(form, "ch1_13_street", client.getCrAddressStreet());
setValueIfPresent(form, "ch1_13_country", client.getCrAddressCountry());
setValueIfPresent(form, "ch1_13_country", client.getCrAddressArea() + " " +client.getCrAddressCountry());
setValueIfPresent(form, "1_13_zip", client.getCrAddressPostalCode());
/*
if("HK".equals(client.getCrAddressArea()))
setValueIfPresent(form, "ch1_13_hk", "Yes");
if("KLN".equals(client.getCrAddressArea()) || "KL".equals(client.getCrAddressArea()) || "KWOLOON".equals(client.getCrAddressArea()))
setValueIfPresent(form, "ch1_13_kln", "Yes");
if("NT".equals(client.getCrAddressArea()))
setValueIfPresent(form, "ch1_13_nt", "Yes");
*/

setValueIfPresent(form, "ch1_13_corr_rm", commonField.getOthers().get("corAddressRoom"));
setValueIfPresent(form, "ch1_13_corr_floor", commonField.getOthers().get("corAddressFloor"));
setValueIfPresent(form, "ch1_13_corr_block", commonField.getOthers().get("corAddressBlock"));
setValueIfPresent(form, "ch1_13_corr_building", commonField.getOthers().get("corAddressBuilding"));
setValueIfPresent(form, "ch1_13_street", commonField.getOthers().get("corAddressStreet"));
setValueIfPresent(form, "ch1_13_corr_street", commonField.getOthers().get("corAddressCountry"));
setValueIfPresent(form, "ch1_13_corr_zip", commonField.getOthers().get("corAddressPostalCode"));
setValueIfPresent(form, "ch1_13_corr_rm", client.getCorAddressRoom());
setValueIfPresent(form, "ch1_13_corr_floor", client.getCorAddressFloor());
setValueIfPresent(form, "ch1_13_corr_block", client.getCorAddressBlock());
setValueIfPresent(form, "ch1_13_corr_building", client.getCorAddressBuilding());
setValueIfPresent(form, "ch1_13_corr_street", client.getCorAddressStreet());
setValueIfPresent(form, "ch1_13_corr_country", client.getCorAddressArea() + " " + client.getCorAddressCountry());
setValueIfPresent(form, "ch1_13_corr_zip", client.getCorAddressPostalCode());
setValueIfPresent(form, "ch1_13_corr_hk", commonField.getOthers().get("corAddressHk"));
setValueIfPresent(form, "ch1_13_corr_kln", commonField.getOthers().get("corAddressKln"));
setValueIfPresent(form, "ch1_13_corr_nt", commonField.getOthers().get("crAddressNt"));
setValueIfPresent(form, "ch1_13_corr_nt", commonField.getOthers().get("corAddressNt"));
setValueIfPresent(form, "1_13_tel_mobile", commonField.getContactNo());
setValueIfPresent(form, "1_13_tel_mobile", client.getPhone1Code() + " " + client.getPhone1());
setValueIfPresent(form, "1_14d_tax1", commonField.getTaxResidency1());
setValueIfPresent(form, "1_14d_tax_num1", commonField.getTaxPin1());
@@ -1699,53 +1680,41 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
//setValueIfPresent(form, "address1", commonField.getOthers().get("address1"));
//setValueIfPresent(form, "address2", commonField.getOthers().get("address2"));
Map<String, String> 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<Pdf, Long, PdfReposito
setValueIfPresent(form, "fill_14_4", formatNum(client.getBonusLast()));
setValueIfPresent(form, "fill_17_7", formatNum(client.getCompanyInterestCurrent()));
setValueIfPresent(form, "fill_18_6", formatNum(client.getCompanyInterestLast()));
setValueIfPresent(form, "fill_2k1_5", formatNum(client.getInvestmentIncomeCurrent()));
setValueIfPresent(form, "fill_2k2_5", formatNum(client.getInvestmentIncomeLast()));
setValueIfPresent(form, "fill_2k9_3", formatNum(client.getDividendsCurrent()));
setValueIfPresent(form, "fill_3k0_3", formatNum(client.getDividendsLast()));
setValueIfPresent(form, "fill_k33_3", formatNum(client.getRentalsCurrent()));
setValueIfPresent(form, "fill_34_2", formatNum(client.getRentalsLast()));
setValueIfPresent(form, "fill_k37_2", formatNum(client.getOtherUnearnedCurrent()));
setValueIfPresent(form, "fill_38_2", formatNum(client.getOtherUnearnedLast()));
setValueIfPresent(form, "fill_37_2", formatNum(client.getTotalUnearnedCurrent()));
setValueIfPresent(form, "fill_38_222", formatNum(client.getTotalUnearnedLast()));
setValueIfPresent(form, "fill_37_2", formatNum(client.getTotalIncomeCurrent()));
setValueIfPresent(form, "fill_38_222", formatNum(client.getTotalIncomeLast()));
setValueIfPresent(form, "fill_1k1_5", formatNum(client.getMortgageCurrent()));
setValueIfPresent(form, "fill_12_511", formatNum(client.getMortgageLast()));
@@ -1794,7 +1764,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "fill_5318", formatNum(client.getPersonalPropertiesCurrent()));
setValueIfPresent(form, "fill_5419", formatNum(client.getPersonalPropertiesLast()));
setValueIfPresent(form, "fill_5720", formatNum(client.getInvestmentsCurrent()));
setValueIfPresent(form, "fill_5419", formatNum(client.getInvestmentsLast()));
setValueIfPresent(form, "fill_5821", formatNum(client.getInvestmentsLast()));
setValueIfPresent(form, "fill_6123", formatNum(client.getOtherLiquidCurrent()));
setValueIfPresent(form, "fill_6224", formatNum(client.getOtherLiquidLast()));
setValueIfPresent(form, "fill_6526", formatNum(client.getOtherNonLiquidCurrent()));
@@ -1806,8 +1776,8 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito

setValueIfPresent(form, "fill_41", formatNum(client.getPersonalLoansCurrent()));
setValueIfPresent(form, "fill_42", formatNum(client.getPersonalLoansLast()));
setValueIfPresent(form, "fill_49", formatNum(client.getMortgageCurrent()));
setValueIfPresent(form, "fill_50", formatNum(client.getMortgageLast()));
setValueIfPresent(form, "fill_49", formatNum(client.getMortgagesCurrent()));
setValueIfPresent(form, "fill_50", formatNum(client.getMortgagesLast()));
setValueIfPresent(form, "fill_53", formatNum(client.getMarginAccountCurrent()));
setValueIfPresent(form, "fill_54", formatNum(client.getMarginAccountLast()));
setValueIfPresent(form, "fill_57", formatNum(client.getLoanGuaranteesCurrent()));
@@ -1815,10 +1785,11 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "fill_61", formatNum(client.getBankingFacilityCurrent()));
setValueIfPresent(form, "fill_62", formatNum(client.getBankingFacilityLast()));
//other 1
setValueIfPresent(form, "fill_65", formatNum(client.getPrincipalCurrent()));
setValueIfPresent(form, "fill_66", formatNum(client.getPrincipalLast()));
setValueIfPresent(form, "fill_69", formatNum(client.getOtherPrefFinanceCurrent()));
setValueIfPresent(form, "fill_70", formatNum(client.getOtherPrefFinanceLast()));
setValueIfPresent(form, "fill_5_7", "Principal");
setValueIfPresent(form, "fill_65", formatNum(client.getPrefFinancePrincipalCurrent()));
setValueIfPresent(form, "fill_66", formatNum(client.getPrefFinancePrincipalLast()));
setValueIfPresent(form, "fill_69", formatNum(client.getPrefFinanceOtherCurrent()));
setValueIfPresent(form, "fill_70", formatNum(client.getPrefFinanceOtherLast()));

setValueIfPresent(form, "fill_1111", formatNum(client.getTotalLiabilitiesCurrent()));
setValueIfPresent(form, "fill_1112", formatNum(client.getTotalLiabilitiesLast()));
@@ -1856,12 +1827,12 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form2, "Check Bokx21", "Yes");
}

if("Yes".equals(commonField.getOthers().get("hkidNon")) || "Yes".equals(commonField.getOthers().get("hkidPerm")))
if("Yes".equals(commonField.getOthers().get("hkidNon")) || "Yes".equals(commonField.getOthers().get("hkidPerm"))){
setValueIfPresent(form2, "Check Bokx21", "Yes");
setValueIfPresent(form2, "Check Box22", commonField.getOthers().get("passportYes"));
setValueIfPresent(form2, "Check Boxk23", commonField.getOthers().get("travelDocYes"));
}else{
setValueIfPresent(form2, "Check Box22", commonField.getOthers().get("passportYes"));
setValueIfPresent(form2, "Check Boxk23", commonField.getOthers().get("travelDocYes"));
}
/* Page1 End */
@@ -1901,7 +1872,11 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form2, "Check Box74", commonField.getOthers().get("formMedical"));
setValueIfPresent(form2, "Check Box75", commonField.getOthers().get("formNonMedical"));
/* Page7 End */
/* Page9 Start */
setValueIfPresent(form2, "Check Box72_1a", commonField.getOthers().get("appyOtherInsuranceYes"));
setValueIfPresent(form2, "Check Box73_1", commonField.getOthers().get("appyOtherInsuranceNo"));
/* Page9 End */
/* Page12 Start */
setValueIfPresent(form2, "Check Box74bb", commonField.getOthers().get("travelYes"));
setValueIfPresent(form2, "Check Box74_1ag", commonField.getOthers().get("travelNo"));
@@ -1925,11 +1900,11 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form2, "Check Box82", commonField.getOthers().get("empOtherBenefitsNo"));
/* Page13 End */
/* Page14 Start */
setValueIfPresent(form2, "Check Box65f", commonField.getOwn_income());
setValueIfPresent(form2, "Check Box65d", commonField.getPremium_financing());
setValueIfPresent(form2, "Check Box65c", commonField.getSavings());
setValueIfPresent(form2, "Check Box65b", commonField.getBankruptYes());
setValueIfPresent(form2, "Check Box83", commonField.getBankruptNo());
setValueIfPresent(form2, "Check Box65f", commonField.getOthers().get("sourceIncome"));
setValueIfPresent(form2, "Check Box65", commonField.getOthers().get("sourceBusiness"));
setValueIfPresent(form2, "Check Box65c", commonField.getOthers().get("sourceInvestment"));
setValueIfPresent(form2, "Check Box65d", commonField.getOthers().get("premiumFinanceYes"));
setValueIfPresent(form2, "Check Box65e", commonField.getOthers().get("sourceOther"));
/* Page14 End */
/* Page25 Start */
setValueIfPresent(form2, "Check Box18211", commonField.getReplaceInsuranceYes());
@@ -1980,24 +1955,24 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "Street1", client.getCrAddressStreet());
setValueIfPresent(form, "City1", client.getCrAddressCity());
setValueIfPresent(form, "District1", client.getCrAddressArea());
setValueIfPresent(form, "Country1", client.getCrAddressCity());
setValueIfPresent(form, "Country1", client.getCrAddressCountry());
setValueIfPresent(form, "PostalCode1", client.getCrAddressPostalCode());
/* Page1 End */
/* Page2 Start */
setValueIfPresent(form, "Room3", commonField.getOthers().get("corAddressRoom"));
setValueIfPresent(form, "Room3", commonField.getOthers().get("corAddressFloor"));
setValueIfPresent(form, "Block3", commonField.getOthers().get("corAddressBlock"));
setValueIfPresent(form, "Building3", commonField.getOthers().get("corAddressBuilding"));
setValueIfPresent(form, "Street3", commonField.getOthers().get("corAddressStreet"));
setValueIfPresent(form, "City3", commonField.getOthers().get("corAddressCity"));
setValueIfPresent(form, "District3", commonField.getOthers().get("corAddressDistrict"));
setValueIfPresent(form, "Country3", commonField.getOthers().get("corAddressCountry"));
setValueIfPresent(form, "PostalCode3", commonField.getOthers().get("corAddressPostalCode"));
setValueIfPresent(form, "ContactA1", commonField.getOthers().get("contactNoCode"));
setValueIfPresent(form, "ContactB1", commonField.getContactNo());
setValueIfPresent(form, "Email", commonField.getEmail());
setValueIfPresent(form, "Room3", client.getCorAddressRoom());
setValueIfPresent(form, "Room3", client.getCorAddressBlock());
setValueIfPresent(form, "Block3", client.getCorAddressBlock());
setValueIfPresent(form, "Building3", client.getCorAddressBuilding());
setValueIfPresent(form, "Street3", client.getCorAddressStreet());
setValueIfPresent(form, "City3", client.getCorAddressCity());
setValueIfPresent(form, "District3", client.getCorAddressArea());
setValueIfPresent(form, "Country3", client.getCorAddressCountry());
setValueIfPresent(form, "PostalCode3", client.getCorAddressPostalCode());
setValueIfPresent(form, "ContactA1", client.getPhone1Code());
setValueIfPresent(form, "ContactB1", client.getPhone1());
setValueIfPresent(form, "Email", client.getEmail());
/* Page2 End */
/* Page3 Start */
setValueIfPresent(form, "Field_Wealth4", commonField.getOthers().get("sourceOtherDesc"));
@@ -2124,21 +2099,18 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
if("NT".equals(client.getCrAddressArea()))
setValueIfPresent(form, "ch1_13a_nt", "Yes");
setValueIfPresent(form, "1_13bc_rm", commonField.getOthers().get("corAddressRoom"));
setValueIfPresent(form, "1_13bc_floor", commonField.getOthers().get("corAddressFloor"));
setValueIfPresent(form, "1_13bc_block", commonField.getOthers().get("corAddressBlock"));
setValueIfPresent(form, "1_13bc_building", commonField.getOthers().get("corAddressBuilding"));
setValueIfPresent(form, "1_13bc_street", commonField.getOthers().get("corAddressStreet"));
setValueIfPresent(form, "1_13bc_district", commonField.getOthers().get("corAddressCountry"));
setValueIfPresent(form, "ch1_13bc_hk", commonField.getOthers().get("corAddressHK"));
setValueIfPresent(form, "ch1_13bc_kln", commonField.getOthers().get("corAddressKln"));
setValueIfPresent(form, "ch1_13bc_nt", commonField.getOthers().get("corAddressNt"));
setValueIfPresent(form, "1_13bc_rm", client.getCorAddressRoom());
setValueIfPresent(form, "1_13bc_floor", client.getCorAddressFloor());
setValueIfPresent(form, "1_13bc_block", client.getCorAddressBlock());
setValueIfPresent(form, "1_13bc_building", client.getCrAddressBuilding());
setValueIfPresent(form, "1_13bc_street", client.getCorAddressStreet());
setValueIfPresent(form, "1_13bc_district", client.getCorAddressArea());
/* Page2 End */
/* Page3 Start */
setValueIfPresent(form, "1_13b_tel_mobile_code", commonField.getOthers().get("contactNoCode"));
setValueIfPresent(form, "1_13b_tel_mobile", commonField.getContactNo());
setValueIfPresent(form, "1_13b_email", commonField.getEmail());
setValueIfPresent(form, "1_13b_tel_mobile_code", client.getPhone1Code());
setValueIfPresent(form, "1_13b_tel_mobile", client.getPhone1());
setValueIfPresent(form, "1_13b_email", client.getEmail());

setValueIfPresent(form, "1_14d_tax1", commonField.getTaxResidency1());
setValueIfPresent(form, "1_14d_tax2", commonField.getTaxResidency2());
@@ -2332,6 +2304,8 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "7_2a_bonuses_24", formatNum(client.getBonusLast()));
setValueIfPresent(form, "7_2a_company", formatNum(client.getCompanyInterestCurrent()));
setValueIfPresent(form, "7_2a_company_24", formatNum(client.getCompanyInterestLast()));
setValueIfPresent(form, "7_2a_invest", formatNum(client.getInvestmentIncomeCurrent()));
setValueIfPresent(form, "7_2a_invest_24", formatNum(client.getInvestmentIncomeLast()));
setValueIfPresent(form, "7_2a_dividends", formatNum(client.getDividendsCurrent()));
setValueIfPresent(form, "7_2a_dividends_24", formatNum(client.getDividendsLast()));
setValueIfPresent(form, "7_2a_rental", formatNum(client.getRentalsCurrent()));
@@ -2349,6 +2323,8 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "7_2c_real_24", formatNum(client.getPersonalPropertiesLast()));
setValueIfPresent(form, "7_2c_stocks", formatNum(client.getInvestmentsCurrent()));
setValueIfPresent(form, "7_2c_stocks_24", formatNum(client.getInvestmentsLast()));
setValueIfPresent(form, "7_2c_business", formatNum(client.getNetBusinessInterestCurrent()));
setValueIfPresent(form, "7_2c_business_24", formatNum(client.getNetBusinessInterestLast()));
setValueIfPresent(form, "7_2c_high", formatNum(client.getPersonalPropertiesCurrent()));
setValueIfPresent(form, "7_2c_high_24", formatNum(client.getPersonalPropertiesLast()));
setValueIfPresent(form, "7_2c_other", addNums(formatNum(client.getOtherLiquidCurrent()), formatNum(client.getOtherNonLiquidCurrent())));
@@ -2362,19 +2338,19 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "7_2c_lia_loan", formatNum(client.getPersonalLoansCurrent()));
setValueIfPresent(form, "7_2c_lia_loan_24", formatNum(client.getPersonalLoansLast()));
setValueIfPresent(form, "7_2c_lia_mortgages", formatNum(client.getMortgageCurrent()));
setValueIfPresent(form, "7_2c_lia_mortgages", formatNum(client.getMortgageLast()));
setValueIfPresent(form, "7_2c_lia_mortgages_24", formatNum(client.getMortgageLast()));
setValueIfPresent(form, "7_2c_lia_margin", formatNum(client.getMarginAccountCurrent()));
setValueIfPresent(form, "7_2c_lia_margin_24", formatNum(client.getMarginAccountLast()));
setValueIfPresent(form, "7_2c_lia_loan", formatNum(client.getLoanGuaranteesCurrent()));
setValueIfPresent(form, "7_2c_lia_margin_24", formatNum(client.getLoanGuaranteesLast()));
setValueIfPresent(form, "7_2c_lia_loan_24", formatNum(client.getLoanGuaranteesLast()));
setValueIfPresent(form, "7_2c_lia_banking", formatNum(client.getBankingFacilityCurrent()));
setValueIfPresent(form, "7_2c_lia_margin_24", formatNum(client.getBankingFacilityLast()));
setValueIfPresent(form, "7_2c_lia_banking_24", formatNum(client.getBankingFacilityLast()));
setValueIfPresent(form, "7_2c_lia_other", addNums(formatNum(client.getOtherPrefFinanceCurrent()), formatNum(client.getPrincipalCurrent())));
setValueIfPresent(form, "7_2c_lia_other_24", addNums(formatNum(client.getOtherPrefFinanceLast()), formatNum(client.getPrincipalLast())));
//sum liabilities
setValueIfPresent(form, "7_2c_lia_total", addNums(form.getField("7_2c_lia_loan").getValueAsString(), form.getField("7_2c_lia_mortgages").getValueAsString(), form.getField("7_2c_lia_margin").getValueAsString(), form.getField("7_2c_lia_loan").getValueAsString(), form.getField("7_2c_lia_other").getValueAsString()));
setValueIfPresent(form, "7_2c_lia_total", addNums(form.getField("7_2c_lia_loan_24").getValueAsString(), form.getField("7_2c_lia_mortgages_24").getValueAsString(), form.getField("7_2c_lia_margin_24").getValueAsString(), form.getField("7_2c_lia_loan_24").getValueAsString(), form.getField("7_2c_lia_other_24").getValueAsString()));
setValueIfPresent(form, "7_2c_lia_total_24", addNums(form.getField("7_2c_lia_loan_24").getValueAsString(), form.getField("7_2c_lia_mortgages_24").getValueAsString(), form.getField("7_2c_lia_margin_24").getValueAsString(), form.getField("7_2c_lia_loan_24").getValueAsString(), form.getField("7_2c_lia_other_24").getValueAsString()));

setValueIfPresent(form, "7_2d_address1_1", commonField.getOthers().get("realEstateAddress1_1"));
setValueIfPresent(form, "7_2d_address1_2", commonField.getOthers().get("realEstateAddress1_2"));
@@ -2721,7 +2697,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
private void IDA(String fieldName, String fieldValue, CommonField commonField,PDAcroForm acroForm){
switch (fieldName) {
/* Page1 Start */
case "fill_7" -> 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<Pdf, Long, PdfReposito
case "date_mm" -> 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<Pdf, Long, PdfReposito
case "edu_pri" -> 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<Pdf, Long, PdfReposito
/* Page6 End */
/* Page7 Start */
case "fill_11_7" -> 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<Pdf, Long, PdfReposito
commonField.setInsuranceCurrency1("USD");
}
}
case "fill_12_7_2" -> {
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<Pdf, Long, PdfReposito
case "fill_1_7" -> 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<Pdf, Long, PdfReposito
commonField.setInsuranceCurrency2("USD");
}
}
case "fill_14_7_2" -> {
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<Pdf, Long, PdfReposito


case "fill_15_7" -> 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<Pdf, Long, PdfReposito
commonField.setInsuranceCurrency3("USD");
}
}
case "fill_16_7_2" -> {
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<Pdf, Long, PdfReposito

case "ultimateTotalLife" -> 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<Pdf, Long, PdfReposito
case "totalLiquidAsset" -> 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<Pdf, Long, PdfReposito


/* Page11 End */
case "toggle_12_3" -> 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<Pdf, Long, PdfReposito
private void FNA(String fieldName, String fieldValue, CommonField commonField,PDAcroForm acroForm){
switch (fieldName) {
/* Page1 Start */
case "fna_a_birth" -> 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<Pdf, Long, PdfReposito
switch (fieldName) {
/* Page1 Start */
case "fill_4" -> 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<Pdf, Long, PdfReposito
case "male" -> 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<Pdf, Long, PdfReposito
if("Yes".equals(fieldValue))
commonField.setPlaceOfBirth("Macau");
}
*/
case "Field_LocationA1" -> 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<Pdf, Long, PdfReposito

case "ContactB1" -> 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<Pdf, Long, PdfReposito
private void SLFNA_EN(String fieldName, String fieldValue, CommonField commonField,PDAcroForm acroForm){
switch (fieldName) {
/* Page1 Start */
case "date_of_birth" -> 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<Pdf, Long, PdfReposito
case "ch1_4_m" -> 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<Pdf, Long, PdfReposito
case "ch1_13_corr_nt" -> 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<Pdf, Long, PdfReposito
/* Page1 Start */
case "fill_17" -> 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<Pdf, Long, PdfReposito

case "fill_19" -> 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<Pdf, Long, PdfReposito

//case "undefined_6" -> 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<Pdf, Long, PdfReposito
case "Check Box178" -> 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<Pdf, Long, PdfReposito
case "ch1_5n" -> 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<Pdf, Long, PdfReposito
case "1_10passport" -> {
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<Pdf, Long, PdfReposito
case "ch1_12_part" -> 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<Pdf, Long, PdfReposito
return StringUtils.trimToEmpty(value);
}

public String getCorAddress1(Client client){
String value = "";
if(!"".equals(StringUtils.trimToEmpty(client.getCorAddressRoom()))){
value += StringUtils.trimToEmpty(client.getCorAddressRoom()) + " ";
}
if(!"".equals(StringUtils.trimToEmpty(client.getCorAddressFloor()))){
value += StringUtils.trimToEmpty(client.getCorAddressFloor()) + " ";
}
if(!"".equals(StringUtils.trimToEmpty(client.getCorAddressBlock()))){
value += StringUtils.trimToEmpty(client.getCorAddressBlock()) + " ";
}
if(!"".equals(StringUtils.trimToEmpty(client.getCorAddressBuilding()))){
value += StringUtils.trimToEmpty(client.getCorAddressBuilding()) + " ";
}
if(!"".equals(StringUtils.trimToEmpty(client.getCorAddressStreet()))){
value += StringUtils.trimToEmpty(client.getCorAddressStreet()) + " ";
}
return StringUtils.trimToEmpty(value);
}

public String getCorAddress2(Client client){
String value = "";
if(!"".equals(StringUtils.trimToEmpty(client.getCorAddressArea()))){
value += StringUtils.trimToEmpty(client.getCorAddressArea()) + " ";
}
if(!"".equals(StringUtils.trimToEmpty(client.getCorAddressCity()))){
value += StringUtils.trimToEmpty(client.getCorAddressCity()) + " ";
}
if(!"".equals(StringUtils.trimToEmpty(client.getCorAddressCountry()))){
value += StringUtils.trimToEmpty(client.getCorAddressCountry()) + " ";
}
return StringUtils.trimToEmpty(value);
}

}

Loading…
取消
儲存