@@ -313,18 +313,20 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
FNA_textBox(form, commonField, client);
FNA_textBox(form, commonField, client);
} else if("HSBCFIN".equals(formCode)){ // This is HSBCFIN
} else if("HSBCFIN".equals(formCode)){ // This is HSBCFIN
HSBCFIN_textBox(form, commonField, client);
HSBCFIN_textBox(form, commonField, client);
}else if ("MLB03S".equals(formCode)) {
MLB03S_textBox(form, commonField, client);
} else if("MLFNA_EN".equals(formCode)){ // This is ML FNA EN
} else if("MLFNA_EN".equals(formCode)){ // This is ML FNA EN
MLFNA_EN_textBox(form, commonField, client);
MLFNA_EN_textBox(form, commonField, client);
} else if("MLFNA_CHI".equals(formCode)){ // This is ML FNA CHI
MLFNA_EN_textBox(form, commonField, client);
} else if("SLFNA_EN".equals(formCode)){ // This is SL FNA EN
} else if("SLFNA_EN".equals(formCode)){ // This is SL FNA EN
SLFNA_EN_textBox(form, commonField, client);
SLFNA_EN_textBox(form, commonField, client);
} else if("SLFNA_CHI".equals(formCode)){ // This is SL FNA CHI
SLFNA_EN_textBox(form, commonField, client);
}else if("SLAPP".equals(formCode)){
}else if("SLAPP".equals(formCode)){
SLAPP_textBox(form, commonField, client);
SLAPP_textBox(form, commonField, client);
}else if("HSBCA31".equals(formCode)){ // This is HSBC A31
}else if("HSBCA31".equals(formCode)){ // This is HSBC A31
HSBCA31_textBox(form, commonField, client);
HSBCA31_textBox(form, commonField, client);
}else if ("MLB03S".equals(formCode)) {
MLB03S_textBox(form, commonField, client);
}else if("SLGII".equals(formCode)){
}else if("SLGII".equals(formCode)){
SLGII_textBox(form, commonField, client);
SLGII_textBox(form, commonField, client);
}
}
@@ -385,16 +387,20 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
FNA_checkBox(form2, commonField);
FNA_checkBox(form2, commonField);
} else if ("HSBCFIN".equals(formCode)) {
} else if ("HSBCFIN".equals(formCode)) {
HSBCFIN_checkBox(form2, commonField);
HSBCFIN_checkBox(form2, commonField);
} else if("MLFNA_EN".equals(formCode)){ // This is ML FNA EN
}else if ("MLB03S".equals(formCode)) {
MLB03S_checkBox(form2, commonField);
}else if("MLFNA_EN".equals(formCode)){ // This is ML FNA EN
MLFNA_EN_checkBox(form2, commonField);
} else if("MLFNA_CHI".equals(formCode)){ // This is ML FNA CHI
MLFNA_EN_checkBox(form2, commonField);
MLFNA_EN_checkBox(form2, commonField);
} else if("SLFNA_EN".equals(formCode)){ // This is SL FNA EN
} else if("SLFNA_EN".equals(formCode)){ // This is SL FNA EN
SLFNA_EN_checkBox(form2, commonField);
SLFNA_EN_checkBox(form2, commonField);
} else if("SLFNA_CHI".equals(formCode)){ // This is SL FNA CHI
SLFNA_EN_checkBox(form2, commonField);
}else if("SLAPP".equals(formCode)){
}else if("SLAPP".equals(formCode)){
SLAPP_checkBox(form2, commonField);
SLAPP_checkBox(form2, commonField);
} else if("HSBCA31".equals(formCode)){
} else if("HSBCA31".equals(formCode)){
HSBCA31_checkBox(form2, commonField);
HSBCA31_checkBox(form2, commonField);
}else if ("MLB03S".equals(formCode)) {
MLB03S_checkBox(form2, commonField);
}else if ("SLGII".equals(formCode)) {
}else if ("SLGII".equals(formCode)) {
SLGII_checkBox(form2, commonField);
SLGII_checkBox(form2, commonField);
}
}
@@ -507,7 +513,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
/* Page7 Start */
/* Page7 Start */
setValueIfPresent(form, "fill_11_7", commonField.getInsuranceCompany1_1());
setValueIfPresent(form, "fill_11_7", commonField.getInsuranceCompany1_1());
setValueIfPresent(form, "fill_11_7_1", commonField.getInsuranceCompany1_2());
setValueIfPresent(form, "fill_11_7_1", commonField.getInsuranceCompany1_2());
setValueIfPresent(form, "fill_11_7_2", commonField.getInsuranceCompany1_3());
// setValueIfPresent(form, "fill_11_7_2", commonField.getInsuranceCompany1_3());
setValueIfPresent(form, "fill_12_7_1", commonField.getOthers().get("insuranceSumInsured1_1"));
setValueIfPresent(form, "fill_12_7_1", commonField.getOthers().get("insuranceSumInsured1_1"));
setValueIfPresent(form, "fill_12_7_2", commonField.getOthers().get("insuranceSumInsured1_2"));
setValueIfPresent(form, "fill_12_7_2", commonField.getOthers().get("insuranceSumInsured1_2"));
setValueIfPresent(form, "fill_12_7_3", commonField.getOthers().get("insuranceSumInsured1_3"));
setValueIfPresent(form, "fill_12_7_3", commonField.getOthers().get("insuranceSumInsured1_3"));
@@ -520,7 +526,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "fill_13_7", commonField.getInsuranceCompany2_1());
setValueIfPresent(form, "fill_13_7", commonField.getInsuranceCompany2_1());
setValueIfPresent(form, "fill_13_7_1", commonField.getInsuranceCompany2_2());
setValueIfPresent(form, "fill_13_7_1", commonField.getInsuranceCompany2_2());
setValueIfPresent(form, "fill_13_7_2", commonField.getInsuranceCompany2_3());
// setValueIfPresent(form, "fill_13_7_2", commonField.getInsuranceCompany2_3());
setValueIfPresent(form, "fill_14_7_1", commonField.getOthers().get("insuranceSumInsured2_1"));
setValueIfPresent(form, "fill_14_7_1", commonField.getOthers().get("insuranceSumInsured2_1"));
setValueIfPresent(form, "fill_14_7_2", commonField.getOthers().get("insuranceSumInsured2_2"));
setValueIfPresent(form, "fill_14_7_2", commonField.getOthers().get("insuranceSumInsured2_2"));
setValueIfPresent(form, "fill_14_7_3", commonField.getOthers().get("insuranceSumInsured2_3"));
setValueIfPresent(form, "fill_14_7_3", commonField.getOthers().get("insuranceSumInsured2_3"));
@@ -528,7 +534,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "fill_3_7", commonField.getInsuranceYear2());
setValueIfPresent(form, "fill_3_7", commonField.getInsuranceYear2());
setValueIfPresent(form, "fill_15_7", commonField.getInsuranceCompany3_1());
setValueIfPresent(form, "fill_15_7", commonField.getInsuranceCompany3_1());
setValueIfPresent(form, "fill_15_7_1", commonField.getInsuranceCompany3_2());
setValueIfPresent(form, "fill_15_7_1", commonField.getInsuranceCompany3_2());
setValueIfPresent(form, "fill_15_7_2", commonField.getInsuranceCompany3_3());
// setValueIfPresent(form, "fill_15_7_2", commonField.getInsuranceCompany3_3());
setValueIfPresent(form, "fill_16_7_1", commonField.getOthers().get("insuranceSumInsured3_1"));
setValueIfPresent(form, "fill_16_7_1", commonField.getOthers().get("insuranceSumInsured3_1"));
setValueIfPresent(form, "fill_16_7_2", commonField.getOthers().get("insuranceSumInsured3_2"));
setValueIfPresent(form, "fill_16_7_2", commonField.getOthers().get("insuranceSumInsured3_2"));
setValueIfPresent(form, "fill_16_7_3", commonField.getOthers().get("insuranceSumInsured3_3"));
setValueIfPresent(form, "fill_16_7_3", commonField.getOthers().get("insuranceSumInsured3_3"));
@@ -1346,7 +1352,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "4_1_name1_1", commonField.getInsuranceCompany1_1());
setValueIfPresent(form, "4_1_name1_1", commonField.getInsuranceCompany1_1());
setValueIfPresent(form, "4_1_name1_2", commonField.getInsuranceCompany1_2());
setValueIfPresent(form, "4_1_name1_2", commonField.getInsuranceCompany1_2());
setValueIfPresent(form, "4_1_name1_3", commonField.getInsuranceCompany1_3());
// setValueIfPresent(form, "4_1_name1_3", commonField.getInsuranceCompany1_3());
setValueIfPresent(form, "4_1_year1", commonField.getInsuranceYear1());
setValueIfPresent(form, "4_1_year1", commonField.getInsuranceYear1());
setValueIfPresent(form, "4_1_currency1", commonField.getInsuranceCurrency1());
setValueIfPresent(form, "4_1_currency1", commonField.getInsuranceCurrency1());
setValueIfPresent(form, "4_1_sum1_1", commonField.getOthers().get("insuranceSumInsured1_1"));
setValueIfPresent(form, "4_1_sum1_1", commonField.getOthers().get("insuranceSumInsured1_1"));
@@ -1355,7 +1361,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "4_1_name2_1", commonField.getInsuranceCompany2_1());
setValueIfPresent(form, "4_1_name2_1", commonField.getInsuranceCompany2_1());
setValueIfPresent(form, "4_1_name2_2", commonField.getInsuranceCompany2_2());
setValueIfPresent(form, "4_1_name2_2", commonField.getInsuranceCompany2_2());
setValueIfPresent(form, "4_1_name2_3", commonField.getInsuranceCompany2_3());
// setValueIfPresent(form, "4_1_name2_3", commonField.getInsuranceCompany2_3());
setValueIfPresent(form, "4_1_year2", commonField.getInsuranceYear2());
setValueIfPresent(form, "4_1_year2", commonField.getInsuranceYear2());
setValueIfPresent(form, "4_1_currency2", commonField.getInsuranceCurrency2());
setValueIfPresent(form, "4_1_currency2", commonField.getInsuranceCurrency2());
setValueIfPresent(form, "4_1_sum2_1", commonField.getOthers().get("insuranceSumInsured2_1"));
setValueIfPresent(form, "4_1_sum2_1", commonField.getOthers().get("insuranceSumInsured2_1"));
@@ -1364,7 +1370,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
setValueIfPresent(form, "4_1_name3_1", commonField.getInsuranceCompany3_1());
setValueIfPresent(form, "4_1_name3_1", commonField.getInsuranceCompany3_1());
setValueIfPresent(form, "4_1_name3_2", commonField.getInsuranceCompany3_2());
setValueIfPresent(form, "4_1_name3_2", commonField.getInsuranceCompany3_2());
setValueIfPresent(form, "4_1_name3_3", commonField.getInsuranceCompany3_3());
// setValueIfPresent(form, "4_1_name3_3", commonField.getInsuranceCompany3_3());
setValueIfPresent(form, "4_1_year3", commonField.getInsuranceYear3());
setValueIfPresent(form, "4_1_year3", commonField.getInsuranceYear3());
setValueIfPresent(form, "4_1_currency3", commonField.getInsuranceCurrency3());
setValueIfPresent(form, "4_1_currency3", commonField.getInsuranceCurrency3());
setValueIfPresent(form, "4_1_sum3_1", commonField.getOthers().get("insuranceSumInsured3_1"));
setValueIfPresent(form, "4_1_sum3_1", commonField.getOthers().get("insuranceSumInsured3_1"));
@@ -1956,13 +1962,13 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
/* Page6 Start */
/* Page6 Start */
setValueIfPresent(form, "4_1_name1_1", commonField.getInsuranceCompany1_1());
setValueIfPresent(form, "4_1_name1_1", commonField.getInsuranceCompany1_1());
setValueIfPresent(form, "4_1_name1_2", commonField.getInsuranceCompany1_2());
setValueIfPresent(form, "4_1_name1_2", commonField.getInsuranceCompany1_2());
setValueIfPresent(form, "4_1_name1_3", commonField.getInsuranceCompany1_3());
// setValueIfPresent(form, "4_1_name1_3", commonField.getInsuranceCompany1_3());
setValueIfPresent(form, "4_1_name2_1", commonField.getInsuranceCompany2_1());
setValueIfPresent(form, "4_1_name2_1", commonField.getInsuranceCompany2_1());
setValueIfPresent(form, "4_1_name2_2", commonField.getInsuranceCompany2_2());
setValueIfPresent(form, "4_1_name2_2", commonField.getInsuranceCompany2_2());
setValueIfPresent(form, "4_1_name2_3", commonField.getInsuranceCompany2_3());
// setValueIfPresent(form, "4_1_name2_3", commonField.getInsuranceCompany2_3());
setValueIfPresent(form, "4_1_name3_1", commonField.getInsuranceCompany3_1());
setValueIfPresent(form, "4_1_name3_1", commonField.getInsuranceCompany3_1());
setValueIfPresent(form, "4_1_name3_2", commonField.getInsuranceCompany3_2());
setValueIfPresent(form, "4_1_name3_2", commonField.getInsuranceCompany3_2());
setValueIfPresent(form, "4_1_name3_3", commonField.getInsuranceCompany3_3());
// setValueIfPresent(form, "4_1_name3_3", commonField.getInsuranceCompany3_3());
setValueIfPresent(form, "4_1_year1", commonField.getInsuranceYear1());
setValueIfPresent(form, "4_1_year1", commonField.getInsuranceYear1());
setValueIfPresent(form, "4_1_year2", commonField.getInsuranceYear2());
setValueIfPresent(form, "4_1_year2", commonField.getInsuranceYear2());
setValueIfPresent(form, "4_1_year3", commonField.getInsuranceYear3());
setValueIfPresent(form, "4_1_year3", commonField.getInsuranceYear3());
@@ -2293,6 +2299,11 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
public List<Map<String,Object>> list(Map<String, Object> args){
public List<Map<String,Object>> list(Map<String, Object> args){
StringBuilder sql = new StringBuilder("SELECT"
StringBuilder sql = new StringBuilder("SELECT"
+ " (select concat('V', count(1) + 1) from filled_form where clientId = ff.clientId and templateId = ff.templateId and id < ff.id) as vNum, "
+ " (select concat('V', count(1) + 1) from filled_form where clientId = ff.clientId and templateId = ff.templateId and id < ff.id) as vNum, "
+ " (select f.id from file_ref fr left join file f on fr.fileId = f.id where fr.refType = 'upload1' and fr.refId = ff.id order by fr.id desc limit 1) as upload1FileId, "
+ " (select f.skey from file_ref fr left join file f on fr.fileId = f.id where fr.refType = 'upload1' and fr.refId = ff.id order by fr.id desc limit 1) as uploadFileSkey, "
+ " (select f.id from file_ref fr left join file f on fr.fileId = f.id where fr.refType = 'upload2' and fr.refId = ff.id order by fr.id desc limit 1) as upload2FileId, "
+ " (select f.skey from file_ref fr left join file f on fr.fileId = f.id where fr.refType = 'upload2' and fr.refId = ff.id order by fr.id desc limit 1) as upload2FileSkey, "
+ " ff.id, "
+ " ff.id, "
+ " ff.templateId, "
+ " ff.templateId, "
+ " ff.fileId, "
+ " ff.fileId, "
@@ -2411,15 +2422,27 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
HSBCFIN(fieldName, fieldValue, commonField, acroForm);
HSBCFIN(fieldName, fieldValue, commonField, acroForm);
}
}
if ("MLB03S".equals(formCode)) {
MLB03S(fieldName, fieldValue, commonField, acroForm);
}
if("MLFNA_EN".equals(formCode)){
if("MLFNA_EN".equals(formCode)){
MLFNA_EN(fieldName, fieldValue, commonField, acroForm);
MLFNA_EN(fieldName, fieldValue, commonField, acroForm);
}
}
if("MLFNA_CHI".equals(formCode)){
MLFNA_EN(fieldName, fieldValue, commonField, acroForm);
}
//
//
if ("SLFNA_EN".equals(formCode)) {
if ("SLFNA_EN".equals(formCode)) {
SLFNA_EN(fieldName, fieldValue, commonField, acroForm);
SLFNA_EN(fieldName, fieldValue, commonField, acroForm);
}
}
if ("SLFNA_CHI".equals(formCode)) {
SLFNA_EN(fieldName, fieldValue, commonField, acroForm);
}
if ("SLAPP".equals(formCode)) {
if ("SLAPP".equals(formCode)) {
SLAPP(fieldName, fieldValue, commonField, acroForm);
SLAPP(fieldName, fieldValue, commonField, acroForm);
}
}
@@ -2428,10 +2451,6 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
HSBCA31(fieldName, fieldValue, commonField, acroForm);
HSBCA31(fieldName, fieldValue, commonField, acroForm);
}
}
if ("MLB03S".equals(formCode)) {
MLB03S(fieldName, fieldValue, commonField, acroForm);
}
if ("SLGII".equals(formCode)) {
if ("SLGII".equals(formCode)) {
SLGII(fieldName, fieldValue, commonField, acroForm);
SLGII(fieldName, fieldValue, commonField, acroForm);
@@ -2599,7 +2618,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
/* Page7 Start */
/* Page7 Start */
case "fill_11_7" -> commonField.setInsuranceCompany1_1(fieldValue);
case "fill_11_7" -> commonField.setInsuranceCompany1_1(fieldValue);
case "fill_11_7_1" -> commonField.setInsuranceCompany1_2(fieldValue);
case "fill_11_7_1" -> commonField.setInsuranceCompany1_2(fieldValue);
case "fill_11_7_2" -> commonField.setInsuranceCompany1_3(fieldValue);
// case "fill_11_7_2" -> commonField.setInsuranceCompany1_3(fieldValue);
case "fill_12_7_1" -> {
case "fill_12_7_1" -> {
commonField.getOthers().put("insuranceSumInsured1_1", fieldValue);
commonField.getOthers().put("insuranceSumInsured1_1", fieldValue);
@@ -2630,7 +2649,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
case "fill_13_7" -> commonField.setInsuranceCompany2_1(fieldValue);
case "fill_13_7" -> commonField.setInsuranceCompany2_1(fieldValue);
case "fill_13_7_1" -> commonField.setInsuranceCompany2_2(fieldValue);
case "fill_13_7_1" -> commonField.setInsuranceCompany2_2(fieldValue);
case "fill_13_7_2" -> commonField.setInsuranceCompany2_3(fieldValue);
// case "fill_13_7_2" -> commonField.setInsuranceCompany2_3(fieldValue);
case "fill_14_7_1" -> {
case "fill_14_7_1" -> {
commonField.getOthers().put("insuranceSumInsured2_1", fieldValue);
commonField.getOthers().put("insuranceSumInsured2_1", fieldValue);
@@ -2662,7 +2681,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
case "fill_15_7" -> commonField.setInsuranceCompany3_1(fieldValue);
case "fill_15_7" -> commonField.setInsuranceCompany3_1(fieldValue);
case "fill_15_7_1" -> commonField.setInsuranceCompany3_2(fieldValue);
case "fill_15_7_1" -> commonField.setInsuranceCompany3_2(fieldValue);
case "fill_15_7_2" -> commonField.setInsuranceCompany3_3(fieldValue);
// case "fill_15_7_2" -> commonField.setInsuranceCompany3_3(fieldValue);
case "fill_16_7_1" -> {
case "fill_16_7_1" -> {
commonField.getOthers().put("insuranceSumInsured3_1", fieldValue);
commonField.getOthers().put("insuranceSumInsured3_1", fieldValue);
@@ -3046,9 +3065,104 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
case "Check Box17" -> commonField.setFna_c2f_50(fieldValue);
case "Check Box17" -> commonField.setFna_c2f_50(fieldValue);
/* Page5 End */
/* Page5 End */
}
}
private void MLB03S(String fieldName, String fieldValue, CommonField commonField,PDAcroForm acroForm){
switch (fieldName) {
/* Page1 Start */
case "SurName1" -> commonField.setFirstName(fieldValue);
case "GivenName1" -> commonField.setGivenName(fieldValue);
case "ChineseName1" -> commonField.setNameChi(fieldValue);
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 "hk" -> {
if("Yes".equals(fieldValue))
commonField.setPlaceOfBirth("Hong Kong");
}
case "macau" -> {
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 "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 "Room1" -> commonField.getOthers().put("crAddressRoom", fieldValue);
case "Floor1" -> commonField.getOthers().put("crAddressFloor", fieldValue);
case "Block1" -> commonField.getOthers().put("crAddressBlock", fieldValue);
case "Building1" -> commonField.getOthers().put("crAddressBuilding", fieldValue);
case "Street1" -> commonField.getOthers().put("crAddressStreet", fieldValue);
case "City1" -> commonField.getOthers().put("crAddressCity", fieldValue);
case "District1" -> commonField.getOthers().put("crAddressDistrict", fieldValue);
case "Country1" -> commonField.getOthers().put("crAddressCountry", fieldValue);
case "PostalCode1" -> commonField.getOthers().put("crAddressPostalCode", fieldValue);
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);
case "Building3" -> commonField.getOthers().put("corAddressBuilding", fieldValue);
case "Street3" -> commonField.getOthers().put("corAddressStreet", fieldValue);
case "City3" -> commonField.getOthers().put("corAddressCity", fieldValue);
case "District3" -> commonField.getOthers().put("corAddressDistrict", fieldValue);
case "Country3" -> commonField.getOthers().put("corAddressCountry", fieldValue);
case "PostalCode3" -> commonField.getOthers().put("corAddressPostalCode", fieldValue);
case "ContactB1" -> commonField.setContactNo(fieldValue);
case "Email" -> commonField.setEmail(fieldValue);
/* Page2 End */
/* Page3 Start */
case "Checkbox_Wealth1" -> commonField.getOthers().put("sourceIncome", fieldValue);
case "Checkbox_Wealth2" -> commonField.getOthers().put("sourceInvestment", fieldValue);
case "Checkbox_Wealth3" -> commonField.getOthers().put("sourceInheritance", fieldValue);
case "Checkbox_Wealth4" -> commonField.getOthers().put("sourceOther", fieldValue);
case "Field_Wealth4" -> commonField.getOthers().put("sourceOtherDesc", fieldValue);
case "Checkbox_EudcationPri" -> commonField.setEduPri(fieldValue);
case "Checkbox_EudcationSec" -> commonField.setEduSec(fieldValue);
case "Checkbox_EudcationPostSec" -> commonField.setEduPostSec(fieldValue);
case "Checkbox_EudcationTer" -> commonField.setEduUni(fieldValue);
/* Page3 End */
/* Page7 Start */
case "Residency1" -> commonField.setTaxResidency1(fieldValue);
case "Residency2" -> commonField.setTaxResidency2(fieldValue);
case "Residency3" -> commonField.setTaxResidency3(fieldValue);
case "TIN1" -> commonField.setTaxPin1(fieldValue);
case "TIN2" -> commonField.setTaxPin2(fieldValue);
case "TIN3" -> commonField.setTaxPin3(fieldValue);
case "ABC1" -> commonField.setTaxReason1(fieldValue);
case "ABC2" -> commonField.setTaxReason2(fieldValue);
case "ABC3" -> commonField.setTaxReason3(fieldValue);
case "Reason1" -> commonField.setTaxReasonB1(fieldValue);
case "Reason2" -> commonField.setTaxReasonB2(fieldValue);
case "Reason3" -> commonField.setTaxReasonB3(fieldValue);
/* Page7 End */
/* Page8 Start */
case "c_DeclartionYes" -> commonField.setReplaceInsuranceYes(fieldValue);
case "c_DeclartionNo" -> commonField.setReplaceInsuranceNo(fieldValue);
/* Page8 End */
}
}
}
}
@@ -3372,7 +3486,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
case "4_1_name1_1" -> commonField.setInsuranceCompany1_1(fieldValue);
case "4_1_name1_1" -> commonField.setInsuranceCompany1_1(fieldValue);
case "4_1_name1_2" -> commonField.setInsuranceCompany1_2(fieldValue);
case "4_1_name1_2" -> commonField.setInsuranceCompany1_2(fieldValue);
case "4_1_name1_3" -> commonField.setInsuranceCompany1_3(fieldValue);
// case "4_1_name1_3" -> commonField.setInsuranceCompany1_3(fieldValue);
case "4_1_year1" -> commonField.setInsuranceYear1(fieldValue);
case "4_1_year1" -> commonField.setInsuranceYear1(fieldValue);
case "4_1_currency1" -> commonField.setInsuranceCurrency1(fieldValue);
case "4_1_currency1" -> commonField.setInsuranceCurrency1(fieldValue);
case "4_1_sum1_1" -> commonField.getOthers().put("insuranceSumInsured1_1", fieldValue);
case "4_1_sum1_1" -> commonField.getOthers().put("insuranceSumInsured1_1", fieldValue);
@@ -3423,7 +3537,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
case "4_1_name2_1" -> commonField.setInsuranceCompany2_1(fieldValue);
case "4_1_name2_1" -> commonField.setInsuranceCompany2_1(fieldValue);
case "4_1_name2_2" -> commonField.setInsuranceCompany2_2(fieldValue);
case "4_1_name2_2" -> commonField.setInsuranceCompany2_2(fieldValue);
case "4_1_name2_3" -> commonField.setInsuranceCompany2_3(fieldValue);
// case "4_1_name2_3" -> commonField.setInsuranceCompany2_3(fieldValue);
case "4_1_year2" -> commonField.setInsuranceYear2(fieldValue);
case "4_1_year2" -> commonField.setInsuranceYear2(fieldValue);
case "4_1_currency2" -> commonField.setInsuranceCurrency2(fieldValue);
case "4_1_currency2" -> commonField.setInsuranceCurrency2(fieldValue);
case "4_1_sum2_1" -> commonField.getOthers().put("insuranceSumInsured2_1", fieldValue);
case "4_1_sum2_1" -> commonField.getOthers().put("insuranceSumInsured2_1", fieldValue);
@@ -3474,7 +3588,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
case "4_1_name3_1" -> commonField.setInsuranceCompany3_1(fieldValue);
case "4_1_name3_1" -> commonField.setInsuranceCompany3_1(fieldValue);
case "4_1_name3_2" -> commonField.setInsuranceCompany3_2(fieldValue);
case "4_1_name3_2" -> commonField.setInsuranceCompany3_2(fieldValue);
case "4_1_name3_3" -> commonField.setInsuranceCompany3_3(fieldValue);
// case "4_1_name3_3" -> commonField.setInsuranceCompany3_3(fieldValue);
case "4_1_year3" -> commonField.setInsuranceYear3(fieldValue);
case "4_1_year3" -> commonField.setInsuranceYear3(fieldValue);
case "4_1_currency3" -> commonField.setInsuranceCurrency3(fieldValue);
case "4_1_currency3" -> commonField.setInsuranceCurrency3(fieldValue);
case "4_1_sum3_1" -> commonField.getOthers().put("insuranceSumInsured3_1", fieldValue);
case "4_1_sum3_1" -> commonField.getOthers().put("insuranceSumInsured3_1", fieldValue);
@@ -3664,104 +3778,6 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
}
}
}
}
private void MLB03S(String fieldName, String fieldValue, CommonField commonField,PDAcroForm acroForm){
switch (fieldName) {
/* Page1 Start */
case "SurName1" -> commonField.setFirstName(fieldValue);
case "GivenName1" -> commonField.setGivenName(fieldValue);
case "ChineseName1" -> commonField.setNameChi(fieldValue);
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 "hk" -> {
if("Yes".equals(fieldValue))
commonField.setPlaceOfBirth("Hong Kong");
}
case "macau" -> {
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 "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 "Room1" -> commonField.getOthers().put("crAddressRoom", fieldValue);
case "Floor1" -> commonField.getOthers().put("crAddressFloor", fieldValue);
case "Block1" -> commonField.getOthers().put("crAddressBlock", fieldValue);
case "Building1" -> commonField.getOthers().put("crAddressBuilding", fieldValue);
case "Street1" -> commonField.getOthers().put("crAddressStreet", fieldValue);
case "City1" -> commonField.getOthers().put("crAddressCity", fieldValue);
case "District1" -> commonField.getOthers().put("crAddressDistrict", fieldValue);
case "Country1" -> commonField.getOthers().put("crAddressCountry", fieldValue);
case "PostalCode1" -> commonField.getOthers().put("crAddressPostalCode", fieldValue);
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);
case "Building3" -> commonField.getOthers().put("corAddressBuilding", fieldValue);
case "Street3" -> commonField.getOthers().put("corAddressStreet", fieldValue);
case "City3" -> commonField.getOthers().put("corAddressCity", fieldValue);
case "District3" -> commonField.getOthers().put("corAddressDistrict", fieldValue);
case "Country3" -> commonField.getOthers().put("corAddressCountry", fieldValue);
case "PostalCode3" -> commonField.getOthers().put("corAddressPostalCode", fieldValue);
case "ContactB1" -> commonField.setContactNo(fieldValue);
case "Email" -> commonField.setEmail(fieldValue);
/* Page2 End */
/* Page3 Start */
case "Checkbox_Wealth1" -> commonField.getOthers().put("sourceIncome", fieldValue);
case "Checkbox_Wealth2" -> commonField.getOthers().put("sourceInvestment", fieldValue);
case "Checkbox_Wealth3" -> commonField.getOthers().put("sourceInheritance", fieldValue);
case "Checkbox_Wealth4" -> commonField.getOthers().put("sourceOther", fieldValue);
case "Field_Wealth4" -> commonField.getOthers().put("sourceOtherDesc", fieldValue);
case "Checkbox_EudcationPri" -> commonField.setEduPri(fieldValue);
case "Checkbox_EudcationSec" -> commonField.setEduSec(fieldValue);
case "Checkbox_EudcationPostSec" -> commonField.setEduPostSec(fieldValue);
case "Checkbox_EudcationTer" -> commonField.setEduUni(fieldValue);
/* Page3 End */
/* Page7 Start */
case "Residency1" -> commonField.setTaxResidency1(fieldValue);
case "Residency2" -> commonField.setTaxResidency2(fieldValue);
case "Residency3" -> commonField.setTaxResidency3(fieldValue);
case "TIN1" -> commonField.setTaxPin1(fieldValue);
case "TIN2" -> commonField.setTaxPin2(fieldValue);
case "TIN3" -> commonField.setTaxPin3(fieldValue);
case "ABC1" -> commonField.setTaxReason1(fieldValue);
case "ABC2" -> commonField.setTaxReason2(fieldValue);
case "ABC3" -> commonField.setTaxReason3(fieldValue);
case "Reason1" -> commonField.setTaxReasonB1(fieldValue);
case "Reason2" -> commonField.setTaxReasonB2(fieldValue);
case "Reason3" -> commonField.setTaxReasonB3(fieldValue);
/* Page7 End */
/* Page8 Start */
case "c_DeclartionYes" -> commonField.setReplaceInsuranceYes(fieldValue);
case "c_DeclartionNo" -> commonField.setReplaceInsuranceNo(fieldValue);
/* Page8 End */
}
}
private void SLGII(String fieldName, String fieldValue, CommonField commonField,PDAcroForm acroForm){
private void SLGII(String fieldName, String fieldValue, CommonField commonField,PDAcroForm acroForm){
switch (fieldName) {
switch (fieldName) {
/* Page1 Start */
/* Page1 Start */
@@ -3892,13 +3908,13 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
/* Page6 Start */
/* Page6 Start */
case "4_1_name1_1" -> commonField.setInsuranceCompany1_1(fieldValue);
case "4_1_name1_1" -> commonField.setInsuranceCompany1_1(fieldValue);
case "4_1_name1_2" -> commonField.setInsuranceCompany1_2(fieldValue);
case "4_1_name1_2" -> commonField.setInsuranceCompany1_2(fieldValue);
case "4_1_name1_3" -> commonField.setInsuranceCompany1_3(fieldValue);
// case "4_1_name1_3" -> commonField.setInsuranceCompany1_3(fieldValue);
case "4_1_name2_1" -> commonField.setInsuranceCompany2_1(fieldValue);
case "4_1_name2_1" -> commonField.setInsuranceCompany2_1(fieldValue);
case "4_1_name2_2" -> commonField.setInsuranceCompany2_2(fieldValue);
case "4_1_name2_2" -> commonField.setInsuranceCompany2_2(fieldValue);
case "4_1_name2_3" -> commonField.setInsuranceCompany2_3(fieldValue);
// case "4_1_name2_3" -> commonField.setInsuranceCompany2_3(fieldValue);
case "4_1_name3_1" -> commonField.setInsuranceCompany3_1(fieldValue);
case "4_1_name3_1" -> commonField.setInsuranceCompany3_1(fieldValue);
case "4_1_name3_2" -> commonField.setInsuranceCompany3_2(fieldValue);
case "4_1_name3_2" -> commonField.setInsuranceCompany3_2(fieldValue);
case "4_1_name3_3" -> commonField.setInsuranceCompany3_3(fieldValue);
// case "4_1_name3_3" -> commonField.setInsuranceCompany3_3(fieldValue);
case "4_1_year1" -> commonField.setInsuranceYear1(fieldValue);
case "4_1_year1" -> commonField.setInsuranceYear1(fieldValue);
case "4_1_year2" -> commonField.setInsuranceYear2(fieldValue);
case "4_1_year2" -> commonField.setInsuranceYear2(fieldValue);
case "4_1_year3" -> commonField.setInsuranceYear3(fieldValue);
case "4_1_year3" -> commonField.setInsuranceYear3(fieldValue);
@@ -4274,4 +4290,27 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito
return d;
return d;
}
}
public Map<String, Object> getFilledFormPdf(Long id) {
StringBuilder sql = new StringBuilder("SELECT"
+ " ff.fileId, "
+ " f.skey as fileSkey, "
+ " (select f.id from file_ref fr left join file f on fr.fileId = f.id where fr.refType = 'upload1' and fr.refId = ff.id order by fr.id desc limit 1) as upload1FileId, "
+ " (select f.id from file_ref fr left join file f on fr.fileId = f.id where fr.refType = 'upload2' and fr.refId = ff.id order by fr.id desc limit 1) as upload2FileId, "
+ " ff.id, "
+ " ff.remarks, "
+ " f.filename, "
+ " t.remarks AS formCode, "
+ " fb.bytes AS blobValue "
+ " FROM filled_form ff "
+ " LEFT JOIN file f ON f.id = ff.fileId "
+ " LEFT JOIN file_blob fb ON f.id = fb.fileId "
+ " LEFT JOIN template t ON t.id = ff.templateId "
+ " WHERE ff.deleted = FALSE "
+ " AND ff.id = :id "
);
return jdbcDao.queryForMap(sql.toString(), Map.of("id", id)).orElse(null);
}
}
}