|
|
|
@@ -21,7 +21,6 @@ import org.apache.pdfbox.pdmodel.PDDocument; |
|
|
|
import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm; |
|
|
|
import org.apache.pdfbox.pdmodel.interactive.form.PDButton; |
|
|
|
import org.apache.pdfbox.pdmodel.interactive.form.PDField; |
|
|
|
import org.checkerframework.checker.units.qual.s; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
@@ -1726,8 +1725,24 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form, "fill_16_2", commonField.getOthers().get("empPosition")); |
|
|
|
setValueIfPresent(form, "fill_17_1", commonField.getOthers().get("empCompanyAddress")); |
|
|
|
|
|
|
|
setValueIfPresent(form, "fill_17_3", StringUtils.trimToEmpty(StringUtils.trimToEmpty(commonField.getTaxPin1()) + StringUtils.trimToEmpty(commonField.getTaxPin2()) + StringUtils.trimToEmpty(commonField.getTaxPin3()))); |
|
|
|
setValueIfPresent(form, "fill_0004", StringUtils.trimToEmpty(StringUtils.trimToEmpty(commonField.getTaxResidency1()) + StringUtils.trimToEmpty(commonField.getTaxResidency2()) + StringUtils.trimToEmpty(commonField.getTaxResidency3()))); |
|
|
|
String taxId = ""; |
|
|
|
String taxCountry = ""; |
|
|
|
|
|
|
|
if(!"".equals(StringUtils.trimToEmpty(commonField.getTaxPin1()))){ |
|
|
|
taxId += StringUtils.trimToEmpty(commonField.getTaxPin1()) + " "; |
|
|
|
taxCountry += StringUtils.trimToEmpty(commonField.getTaxResidency1()) + ""; |
|
|
|
} |
|
|
|
if(!"".equals(StringUtils.trimToEmpty(commonField.getTaxPin2()))){ |
|
|
|
taxId += StringUtils.trimToEmpty(commonField.getTaxPin2()) + " "; |
|
|
|
taxCountry += StringUtils.trimToEmpty(commonField.getTaxResidency2()) + ""; |
|
|
|
} |
|
|
|
if(!"".equals(StringUtils.trimToEmpty(commonField.getTaxPin3()))){ |
|
|
|
taxId += StringUtils.trimToEmpty(commonField.getTaxPin3()) + " "; |
|
|
|
taxCountry += StringUtils.trimToEmpty(commonField.getTaxResidency3()) + ""; |
|
|
|
} |
|
|
|
|
|
|
|
setValueIfPresent(form, "fill_17_3", StringUtils.trimToEmpty(taxId)); |
|
|
|
setValueIfPresent(form, "fill_0004", StringUtils.trimToEmpty(taxCountry)); |
|
|
|
|
|
|
|
/* Page2 End */ |
|
|
|
/* Page3 Start */ |
|
|
|
@@ -1862,7 +1877,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form2, "Checkk Box6", commonField.getGenderMale()); |
|
|
|
setValueIfPresent(form2, "Check kBox7", commonField.getGenderFemale()); |
|
|
|
|
|
|
|
if(!"".equals(client.getCrAddressPostalCode())){ |
|
|
|
if(!"".equals(client.getCrAddressCity())){ |
|
|
|
setValueIfPresent(form2, "Check Box10", "Yes"); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -1997,7 +2012,15 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
} |
|
|
|
|
|
|
|
private void MLB03S_textBox(PdfAcroForm form, CommonField commonField, Client client){ |
|
|
|
/* Page1 Start */ |
|
|
|
/* Page1 Start */ |
|
|
|
if(client != null && client.getConsultantId() != null){ |
|
|
|
Consultant consultant = consultantService.find(Long.valueOf(client.getConsultantId())).orElseThrow(); |
|
|
|
|
|
|
|
if(consultant.getName() != null){ |
|
|
|
setValueIfPresent(form, "BranchName", consultant.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
setValueIfPresent(form, "SurName1", StringUtils.trimToEmpty(client.getLastname())); |
|
|
|
setValueIfPresent(form, "GivenName1", StringUtils.trimToEmpty(client.getFirstname())); |
|
|
|
|
|
|
|
@@ -2080,26 +2103,31 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form2, "male", commonField.getGenderMale()); |
|
|
|
setValueIfPresent(form2, "female", commonField.getGenderFemale()); |
|
|
|
|
|
|
|
if("HONG KONG".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "HK".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "HONGKONG".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "HK SAR".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "HKSAR".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "香港".equals(commonField.getPlaceOfBirth().toUpperCase())){ |
|
|
|
setValueIfPresent(form2, "hk", "Yes"); |
|
|
|
} |
|
|
|
if("HONG KONG".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "MACAU".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "澳門".equals(commonField.getPlaceOfBirth().toUpperCase())){ |
|
|
|
setValueIfPresent(form2, "macau", "Yes"); |
|
|
|
if(!"".equals(StringUtils.trimToEmpty(commonField.getPlaceOfBirth())) |
|
|
|
|| !"".equals(commonField.getCountryOfCitizenship())){ |
|
|
|
if("HONG KONG".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "HK".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "HONGKONG".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "HK SAR".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "HKSAR".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "香港".equals(commonField.getPlaceOfBirth().toUpperCase())){ |
|
|
|
setValueIfPresent(form2, "hk", "Yes"); |
|
|
|
}else if("MACAU".equals(commonField.getPlaceOfBirth().toUpperCase()) |
|
|
|
|| "澳門".equals(commonField.getPlaceOfBirth().toUpperCase())){ |
|
|
|
setValueIfPresent(form2, "macau", "Yes"); |
|
|
|
}else{ |
|
|
|
setValueIfPresent(form2, "Checkbox_Location1", "Yes"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
setValueIfPresent(form2, "Checkbox_ID11", commonField.getOthers().get("hkidPerm")); |
|
|
|
setValueIfPresent(form2, "Checkbox_ID12", commonField.getOthers().get("hkidNon")); |
|
|
|
logger.info("##### prcId:" +commonField.getOthers().get("prcId")); |
|
|
|
setValueIfPresent(form2, "Checkbox_ID14", commonField.getOthers().get("prcId")); |
|
|
|
setValueIfPresent(form2, "Checkbox_ID16", commonField.getOthers().get("passportYes")); |
|
|
|
setValueIfPresent(form2, "Checkbox_ID17", commonField.getOthers().get("othersId")); |
|
|
|
if(!"Yes".equals(commonField.getOthers().get("hkidPerm"))){ |
|
|
|
setValueIfPresent(form2, "Checkbox_ID12", commonField.getOthers().get("hkidNon")); |
|
|
|
setValueIfPresent(form2, "Checkbox_ID14", commonField.getOthers().get("prcId")); |
|
|
|
setValueIfPresent(form2, "Checkbox_ID16", commonField.getOthers().get("passportYes")); |
|
|
|
setValueIfPresent(form2, "Checkbox_ID17", commonField.getOthers().get("othersId")); |
|
|
|
} |
|
|
|
|
|
|
|
setValueIfPresent(form2, "Checkbox_Y", commonField.getTobarccoYes()); |
|
|
|
setValueIfPresent(form2, "Checkbox_N", commonField.getTobarccoNo()); |
|
|
|
@@ -3044,8 +3072,8 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
case "fill_10_7" -> commonField.getOthers().put("replaceInsuranceDesc", fieldValue); |
|
|
|
/* Page7 End */ |
|
|
|
/* Page8 Start */ |
|
|
|
case "toggle_1_4" -> commonField.getOthers().put("usPerson", fieldValue); |
|
|
|
case "toggle_2_3" -> commonField.getOthers().put("usPersonNot", fieldValue); |
|
|
|
case "toggle_2_3" -> commonField.getOthers().put("usPerson", fieldValue); |
|
|
|
case "toggle_1_4" -> commonField.getOthers().put("usPersonNot", fieldValue); |
|
|
|
|
|
|
|
case "employed" -> commonField.setEmployed(fieldValue); |
|
|
|
case "homemaker" -> commonField.setHomemaker(fieldValue); |
|
|
|
|