|
|
@@ -4,8 +4,6 @@ import java.io.ByteArrayInputStream; |
|
|
|
import java.io.File; |
|
|
|
import java.io.FileOutputStream; |
|
|
|
import java.io.IOException; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@@ -308,9 +306,6 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form, "date_yyyy", commonField.getYyyyDateOfBirth()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "fill_17", commonField.getContactNo()); |
|
|
|
setValueIfPresent(form, "edu_pri", commonField.getEduPri()); |
|
|
|
setValueIfPresent(form, "edu_sec", commonField.getEduSec()); |
|
|
|
setValueIfPresent(form, "edu_post_sec", commonField.getEduPostSec()); |
|
|
|
/* Page1 End */ |
|
|
|
/* Page2 Start */ |
|
|
|
setValueIfPresent(form, "own_income", commonField.getOwn_income()); |
|
|
@@ -319,24 +314,24 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form, "others_funds", commonField.getOthers_funds()); |
|
|
|
setValueIfPresent(form, "others_funds_desc", commonField.getOthers_funds_desc()); |
|
|
|
/* Page2 End */ |
|
|
|
/* Page3 Start */ |
|
|
|
/* Page9 Start */ |
|
|
|
setValueIfPresent(form, "fill_26_4", commonField.getFna_c1a_amount()); |
|
|
|
/* Page3 End */ |
|
|
|
/* Page4 Start */ |
|
|
|
|
|
|
|
setValueIfPresent(form, "total_asset", commonField.getFna_c2a_amount()); |
|
|
|
setValueIfPresent(form, "fill_56", commonField.getFna_c2b_amount()); |
|
|
|
/* Page9 End */ |
|
|
|
|
|
|
|
} else if("FNA".equals(formCode)){ // This is FNA |
|
|
|
//logger.info("Processing FNA form (ID: 2)"); |
|
|
|
/* Page1 Start */ |
|
|
|
setValueIfPresent(form, "fna_a_name", commonField.getName()); |
|
|
|
setValueIfPresent(form, "fna_a_birth", commonField.getDateOfBirth()); |
|
|
|
setValueIfPresent(form, "fna_a_id_card", commonField.getIdCard()); |
|
|
|
setValueIfPresent(form, "fna_a_occupation", commonField.getOccupation()); |
|
|
|
setValueIfPresent(form, "fna_a_primary", commonField.getEduPri()); |
|
|
|
setValueIfPresent(form, "fna_a_secondary", commonField.getEduSec()); |
|
|
|
setValueIfPresent(form, "fna_a_tertiary", commonField.getEduTer()); |
|
|
|
setValueIfPresent(form, "fna_a_tertiary", commonField.getEduPostSec()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "fna_a_tertiary", commonField.getEduTer()); |
|
|
|
setValueIfPresent(form, "fna_a_marital", commonField.getMaritalStatus()); |
|
|
|
setValueIfPresent(form, "fna_a_contact", commonField.getContactNo()); |
|
|
|
setValueIfPresent(form, "fna_a_dependents", commonField.getNoOfDependents()); |
|
|
@@ -356,60 +351,25 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form, "fna_b1_a", commonField.getFna_b1_a()); |
|
|
|
setValueIfPresent(form, "fna_b1_a_amount", commonField.getFna_b1_a_amount()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "fna_b1_b", commonField.getFna_b1_b()); |
|
|
|
setValueIfPresent(form, "fna_b1a_4_amount", commonField.getFna_b1a_4_amount()); |
|
|
|
setValueIfPresent(form, "fna_b1_c", commonField.getFna_b1_c()); |
|
|
|
setValueIfPresent(form, "fna_b1_d", commonField.getFna_b1_d()); |
|
|
|
|
|
|
|
|
|
|
|
setValueIfPresent(form, "fna_b1_d_year", commonField.getFna_b1_d_year()); |
|
|
|
setValueIfPresent(form, "fna_b1_d_amount", commonField.getFna_b1_d_amount()); |
|
|
|
/* Page1 End */ |
|
|
|
/* Page2 Start */ |
|
|
|
setValueIfPresent(form, "fna_b1_e", commonField.getFna_b1_e()); |
|
|
|
setValueIfPresent(form, "fna_b1_f", commonField.getFna_b1_f()); |
|
|
|
setValueIfPresent(form, "fna_b1_f_other", commonField.getFna_b1_f_other()); |
|
|
|
setValueIfPresent(form, "fna_b1_f_desc", commonField.getFna_b1_f_desc()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "fna_b2_a", commonField.getFna_b2_a()); |
|
|
|
setValueIfPresent(form, "fna_b2_b", commonField.getFna_b2_b()); |
|
|
|
setValueIfPresent(form, "fna_b2_d", commonField.getFna_b2_d()); |
|
|
|
setValueIfPresent(form, "fna_b2_e", commonField.getFna_b2_e()); |
|
|
|
setValueIfPresent(form, "fna_b2_f", commonField.getFna_b2_f()); |
|
|
|
setValueIfPresent(form, "fna_b2_g", commonField.getFna_b2_g()); |
|
|
|
/* Page2 End */ |
|
|
|
/* Page3 Start */ |
|
|
|
setValueIfPresent(form, "fna_c1e_10", commonField.getFna_c1e_10()); |
|
|
|
setValueIfPresent(form, "fna_c1e_10_20", commonField.getFna_c1e_10_20()); |
|
|
|
setValueIfPresent(form, "fna_c1e_21_30", commonField.getFna_c1e_21_30()); |
|
|
|
setValueIfPresent(form, "fna_c1e_31_40", commonField.getFna_c1e_31_40()); |
|
|
|
setValueIfPresent(form, "fna_c1e_41_50", commonField.getFna_c1e_41_50()); |
|
|
|
setValueIfPresent(form, "fna_c1e_50", commonField.getFna_c1e_50()); |
|
|
|
|
|
|
|
/* Page3 End */ |
|
|
|
/* Page4 Start */ |
|
|
|
setValueIfPresent(form, "fna_c2f_10", commonField.getFna_c2f_10()); |
|
|
|
setValueIfPresent(form, "fna_c2f_10_20", commonField.getFna_c2f_10_20()); |
|
|
|
setValueIfPresent(form, "fna_c2f_21_30", commonField.getFna_c2f_21_30()); |
|
|
|
setValueIfPresent(form, "fna_c2f_31_40", commonField.getFna_c2f_31_40()); |
|
|
|
setValueIfPresent(form, "fna_c2f_41_50", commonField.getFna_c2f_41_50()); |
|
|
|
setValueIfPresent(form, "fna_c2f_50", commonField.getFna_c2f_50()); |
|
|
|
|
|
|
|
/* Page4 End */ |
|
|
|
/* Page5 End */ |
|
|
|
setValueIfPresent(form, "fna_c3a_2_5", commonField.getFna_c3a_2_5()); |
|
|
|
setValueIfPresent(form, "fna_c3a_6_10", commonField.getFna_c3a_6_10()); |
|
|
|
setValueIfPresent(form, "fna_c3a_11_15", commonField.getFna_c3a_11_15()); |
|
|
|
setValueIfPresent(form, "fna_c3a_16_20", commonField.getFna_c3a_16_20()); |
|
|
|
setValueIfPresent(form, "fna_c3a_20", commonField.getFna_c3a_20()); |
|
|
|
setValueIfPresent(form, "fna_c3a_life", commonField.getFna_c3a_life()); |
|
|
|
setValueIfPresent(form, "fna_c3a_single_pay", commonField.getFna_c3a_single_pay()); |
|
|
|
|
|
|
|
/* Page5 End */ |
|
|
|
setValueIfPresent(form, "fna_a_retire", commonField.getFna_a_retire()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "fna_c3b_salary", commonField.getFna_c3b_salary()); |
|
|
|
setValueIfPresent(form, "fna_c3b_income", commonField.getFna_c3b_income()); |
|
|
|
setValueIfPresent(form, "fna_c3b_saving", commonField.getFna_c3b_saving()); |
|
|
|
setValueIfPresent(form, "fna_c3b_investments", commonField.getFna_c3b_investments()); |
|
|
|
setValueIfPresent(form, "fna_c3b_policy", commonField.getFna_c3b_policy()); |
|
|
|
setValueIfPresent(form, "fna_c3b_others", commonField.getFna_c3b_others()); |
|
|
|
setValueIfPresent(form, "fna_c3b_desc", commonField.getFna_c3b_desc()); |
|
|
|
/* Page5 End */ |
|
|
|
|
|
|
@@ -426,17 +386,11 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form, "fill_8", commonField.getNoOfDependents()); |
|
|
|
setValueIfPresent(form, "fill_10", commonField.getContactNo());; |
|
|
|
|
|
|
|
setValueIfPresent(form, "toggle_1", commonField.getEduPri()); |
|
|
|
setValueIfPresent(form, "toggle_2", commonField.getEduSec()); |
|
|
|
setValueIfPresent(form, "toggle_3", commonField.getEduPostSec()); |
|
|
|
setValueIfPresent(form, "toggle_3", commonField.getEduTer()); |
|
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(commonField.getFna_c1a_amount())){ |
|
|
|
setValueIfPresent(form, "fill_11", NumberUtils.toScaledBigDecimal(NumberUtils.toScaledBigDecimal(commonField.getFna_c1a_amount(), 0, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(12))).toString() ); //annual |
|
|
|
setValueIfPresent(form, "fill_11", commonField.getFna_c1a_amount() ); //annual |
|
|
|
} |
|
|
|
if(StringUtils.isNotEmpty(commonField.getFna_c1b_amount())){ |
|
|
|
setValueIfPresent(form, "fill_12", NumberUtils.toScaledBigDecimal(NumberUtils.toScaledBigDecimal(commonField.getFna_c1b_amount(), 0, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(12))).toString() ); //annual |
|
|
|
setValueIfPresent(form, "fill_12", commonField.getFna_c1b_amount() ); //annual |
|
|
|
} |
|
|
|
|
|
|
|
setValueIfPresent(form, "fill_12a", commonField.getFna_c1c_3_amount()); |
|
|
@@ -451,63 +405,50 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form, "fill_04", commonField.getFna_c2d_amount()); |
|
|
|
setValueIfPresent(form, "fill_05", commonField.getFna_c2e_amount()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "Financial Protection", commonField.getFna_b1_a()); |
|
|
|
setValueIfPresent(form, "Preparation", commonField.getFna_b1_b()); |
|
|
|
setValueIfPresent(form, "Providing", commonField.getFna_b1_c());; |
|
|
|
setValueIfPresent(form, "Saving", commonField.getFna_b1_d()); |
|
|
|
setValueIfPresent(form, "Investment", commonField.getFna_b1_e()); |
|
|
|
setValueIfPresent(form, "Others", commonField.getFna_b1_f()); |
|
|
|
setValueIfPresent(form, "fill_8_2", commonField.getFna_b1_f_other()); |
|
|
|
setValueIfPresent(form, "fill_8_21", commonField.getFna_b1_f_desc()); |
|
|
|
/* Page2 End */ |
|
|
|
/* Page3 Start */ |
|
|
|
setValueIfPresent(form, "toggle_91", commonField.getFna_b1_a()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "fill_1_4", commonField.getFna_b1_a_amount()); |
|
|
|
setValueIfPresent(form, "fill_1_4b", commonField.getFna_b1_b()); |
|
|
|
setValueIfPresent(form, "toggle_93", commonField.getFna_b1_d()); |
|
|
|
setValueIfPresent(form, "fill_1_4b", commonField.getFna_b1a_4_amount()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "fill_1_4c", commonField.getFna_b1_d_year()); |
|
|
|
setValueIfPresent(form, "fill_1_4d", commonField.getFna_b1_d_year()); |
|
|
|
setValueIfPresent(form, "fill_1_4e", commonField.getFna_b1_d_amount()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "toggle_4_2", commonField.getFna_b2_a()); |
|
|
|
setValueIfPresent(form, "toggle_5", commonField.getFna_b2_b()); |
|
|
|
setValueIfPresent(form, "toggle_6", commonField.getFna_b2_c()); |
|
|
|
setValueIfPresent(form, "toggle_7", commonField.getFna_b2_d()); |
|
|
|
setValueIfPresent(form, "toggle_8", commonField.getFna_b2_e()); |
|
|
|
setValueIfPresent(form, "toggle_9", commonField.getFna_b2_f()); |
|
|
|
setValueIfPresent(form, "toggle_10", commonField.getFna_b2_g()); |
|
|
|
/* Page3 End */ |
|
|
|
/* Page4 Start */ |
|
|
|
setValueIfPresent(form, "toggle_1_2", commonField.getFna_c3a_2_5()); |
|
|
|
setValueIfPresent(form, "toggle_2_2", commonField.getFna_c3a_6_10()); |
|
|
|
setValueIfPresent(form, "toggle_3_2", commonField.getFna_c3a_11_15()); |
|
|
|
setValueIfPresent(form, "toggle_4_3", commonField.getFna_c3a_16_20()); |
|
|
|
setValueIfPresent(form, "toggle_5_2", commonField.getFna_c3a_20()); |
|
|
|
setValueIfPresent(form, "toggle_6_2", commonField.getFna_c3a_life()); |
|
|
|
setValueIfPresent(form, "toggle_6_2_sum", commonField.getFna_c3a_2_5()); |
|
|
|
setValueIfPresent(form, "fill_98_04", commonField.getFna_a_retire()); |
|
|
|
|
|
|
|
/* Page4 End */ |
|
|
|
/* Page5 Start */ |
|
|
|
setValueIfPresent(form, "toggle_1f", commonField.getFna_c3b_income()); |
|
|
|
setValueIfPresent(form, "toggle_1g", commonField.getFna_c3b_saving()); |
|
|
|
setValueIfPresent(form, "toggle_1h", commonField.getFna_c3b_policy()); |
|
|
|
setValueIfPresent(form, "toggle_1i56", commonField.getFna_c3b_others()); |
|
|
|
setValueIfPresent(form, "Text3", commonField.getFna_c3b_desc()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "Check Box6", commonField.getFna_c1e_10()); |
|
|
|
setValueIfPresent(form, "Check Box7", commonField.getFna_c1e_10_20()); |
|
|
|
setValueIfPresent(form, "Check Box8", commonField.getFna_c1e_21_30()); |
|
|
|
setValueIfPresent(form, "Check Box9", commonField.getFna_c1e_31_40()); |
|
|
|
setValueIfPresent(form, "Check Box10", commonField.getFna_c1e_41_50()); |
|
|
|
setValueIfPresent(form, "Check Box11", commonField.getFna_c1e_50()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "Check Box12", commonField.getFna_c2f_10()); |
|
|
|
setValueIfPresent(form, "Check Box13", commonField.getFna_c2f_10_20()); |
|
|
|
setValueIfPresent(form, "Check Box14", commonField.getFna_c2f_21_30()); |
|
|
|
setValueIfPresent(form, "Check Box15", commonField.getFna_c2f_31_40()); |
|
|
|
setValueIfPresent(form, "Check Box16", commonField.getFna_c2f_41_50()); |
|
|
|
setValueIfPresent(form, "Check Box17", commonField.getFna_c2f_50()); |
|
|
|
|
|
|
|
/* Page5 End */ |
|
|
|
} |
|
|
|
} else if("MLFNA_EN".equals(formCode)){ // This is ML FNA EN |
|
|
|
/* |
|
|
|
* /* Page1 Start */ |
|
|
|
setValueIfPresent(form, "part1", commonField.getName()); |
|
|
|
setValueIfPresent(form, "part2_1a_amount", commonField.getFna_b1_a_amount()); |
|
|
|
setValueIfPresent(form, "part2_1c_amount", commonField.getFna_b1_d_amount()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "part2_1e_desc", commonField.getFna_b1_b()); |
|
|
|
setValueIfPresent(form, "part2_1f_desc", commonField.getFna_b1_f_other()); |
|
|
|
/* Page1 End */ |
|
|
|
/* Page2 Start */ |
|
|
|
setValueIfPresent(form, "part3_3_1", commonField.getFna_c1a_amount()); |
|
|
|
setValueIfPresent(form, "part3_3_2", commonField.getFna_c1b_amount()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "part3_3_4", commonField.getFna_c2a_amount()); |
|
|
|
setValueIfPresent(form, "part3_3_5_2c_other", commonField.getFna_c3b_desc()); |
|
|
|
|
|
|
|
setValueIfPresent(form, "part3_3_6_2", commonField.getFna_c1c_3_amount()); |
|
|
|
/* Page2 End */ |
|
|
|
/* Page3 Start */ |
|
|
|
|
|
|
|
/* Page3 End */ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@@ -570,7 +511,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
} else if ("FNA".equals(formCode)) { |
|
|
|
setValueIfPresent(form2, "fna_a_primary", commonField.getEduPri()); |
|
|
|
setValueIfPresent(form2, "fna_a_secondary", commonField.getEduSec()); |
|
|
|
setValueIfPresent(form2, "fna_a_tertiary", commonField.getEduTer()); |
|
|
|
setValueIfPresent(form2, "fna_a_tertiary", commonField.getEduPostSec()); |
|
|
|
setValueIfPresent(form2, "fna_b1_a", commonField.getFna_b1_a()); |
|
|
|
setValueIfPresent(form2, "fna_b1_a_amount", commonField.getFna_b1_a_amount()); |
|
|
|
setValueIfPresent(form2, "fna_b1_b", commonField.getFna_b1_b()); |
|
|
@@ -603,7 +544,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form2, "fna_c3a_20", commonField.getFna_c3a_20()); |
|
|
|
setValueIfPresent(form2, "fna_c3a_life", commonField.getFna_c3a_life()); |
|
|
|
setValueIfPresent(form2, "fna_c3a_single_pay", commonField.getFna_c3a_single_pay()); |
|
|
|
setValueIfPresent(form2, "fna_a_retire", commonField.getFna_a_retire()); |
|
|
|
|
|
|
|
setValueIfPresent(form2, "fna_c3b_salary", commonField.getFna_c3b_salary()); |
|
|
|
setValueIfPresent(form2, "fna_c3b_income", commonField.getFna_c3b_income()); |
|
|
|
setValueIfPresent(form2, "fna_c3b_saving", commonField.getFna_c3b_saving()); |
|
|
@@ -615,7 +556,6 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form2, "toggle_1", commonField.getEduPri()); |
|
|
|
setValueIfPresent(form2, "toggle_2", commonField.getEduSec()); |
|
|
|
setValueIfPresent(form2, "toggle_3", commonField.getEduPostSec()); |
|
|
|
setValueIfPresent(form2, "toggle_3", commonField.getEduTer()); |
|
|
|
setValueIfPresent(form2, "Financial Protection", commonField.getFna_b1_a()); |
|
|
|
setValueIfPresent(form2, "Preparation", commonField.getFna_b1_b()); |
|
|
|
setValueIfPresent(form2, "Providing", commonField.getFna_b1_c()); |
|
|
@@ -624,8 +564,12 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form2, "Others", commonField.getFna_b1_f()); |
|
|
|
setValueIfPresent(form2, "fill_8_2", commonField.getFna_b1_f_other()); |
|
|
|
setValueIfPresent(form2, "toggle_91", commonField.getFna_b1_a()); |
|
|
|
setValueIfPresent(form2, "fill_1_4b", commonField.getFna_b1_b()); |
|
|
|
setValueIfPresent(form2, "toggle_93", commonField.getFna_b1_d()); |
|
|
|
|
|
|
|
if("yes".equals(commonField.getFna_b1b_1()) || "yes".equals(commonField.getFna_b1b_2())) |
|
|
|
setValueIfPresent(form2, "toggle_93", "yes"); |
|
|
|
|
|
|
|
setValueIfPresent(form2, "toggle_94", commonField.getFna_b1b_3()); |
|
|
|
|
|
|
|
setValueIfPresent(form2, "toggle_4_2", commonField.getFna_b2_a()); |
|
|
|
setValueIfPresent(form2, "toggle_5", commonField.getFna_b2_b()); |
|
|
|
setValueIfPresent(form2, "toggle_6", commonField.getFna_b2_c()); |
|
|
@@ -633,17 +577,23 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form2, "toggle_8", commonField.getFna_b2_e()); |
|
|
|
setValueIfPresent(form2, "toggle_9", commonField.getFna_b2_f()); |
|
|
|
setValueIfPresent(form2, "toggle_10", commonField.getFna_b2_g()); |
|
|
|
|
|
|
|
setValueIfPresent(form2, "toggle_1_2", commonField.getFna_c3a_2_5()); |
|
|
|
setValueIfPresent(form2, "toggle_2_2", commonField.getFna_c3a_6_10()); |
|
|
|
setValueIfPresent(form2, "toggle_3_2", commonField.getFna_c3a_11_15()); |
|
|
|
setValueIfPresent(form2, "toggle_4_3", commonField.getFna_c3a_16_20()); |
|
|
|
setValueIfPresent(form2, "toggle_5_2", commonField.getFna_c3a_20()); |
|
|
|
setValueIfPresent(form2, "toggle_6_2", commonField.getFna_c3a_life()); |
|
|
|
setValueIfPresent(form2, "toggle_6_2_sum", commonField.getFna_c3a_2_5()); |
|
|
|
setValueIfPresent(form2, "toggle_1f", commonField.getFna_c3b_income()); |
|
|
|
setValueIfPresent(form2, "toggle_1g", commonField.getFna_c3b_saving()); |
|
|
|
setValueIfPresent(form2, "toggle_1h", commonField.getFna_c3b_policy()); |
|
|
|
setValueIfPresent(form2, "toggle_1i56", commonField.getFna_c3b_others()); |
|
|
|
setValueIfPresent(form2, "toggle_6_2_sum", commonField.getFna_c3a_single_pay()); |
|
|
|
if("yes".equals(commonField.getFna_c3b_salary()) |
|
|
|
&& "yes".equals(commonField.getFna_c3b_income())){ |
|
|
|
setValueIfPresent(form2, "toggle_1f", "yes"); |
|
|
|
} |
|
|
|
if("yes".equals(commonField.getFna_c3b_saving()) |
|
|
|
&& "yes".equals(commonField.getFna_c3b_investments())){ |
|
|
|
setValueIfPresent(form2, "toggle_1g", "yes"); |
|
|
|
} |
|
|
|
setValueIfPresent(form2, "toggle_1h", commonField.getFna_c3c_yes()); |
|
|
|
setValueIfPresent(form2, "Check Box6", commonField.getFna_c1e_10()); |
|
|
|
setValueIfPresent(form2, "Check Box7", commonField.getFna_c1e_10_20()); |
|
|
|
setValueIfPresent(form2, "Check Box8", commonField.getFna_c1e_21_30()); |
|
|
@@ -656,6 +606,65 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
setValueIfPresent(form2, "Check Box15", commonField.getFna_c2f_31_40()); |
|
|
|
setValueIfPresent(form2, "Check Box16", commonField.getFna_c2f_41_50()); |
|
|
|
setValueIfPresent(form2, "Check Box17", commonField.getFna_c2f_50()); |
|
|
|
|
|
|
|
//one way mapping now |
|
|
|
setValueIfPresent(form2, "toggle_1c", commonField.getFna_c3a_single_pay()); |
|
|
|
} else if("MLFNA_EN".equals(formCode)){ // This is ML FNA EN |
|
|
|
/* |
|
|
|
* /* Page1 Start */ |
|
|
|
// exported year? only can one way from FNA b1 d year |
|
|
|
setValueIfPresent(form2, "part2_1a", commonField.getFna_b1_a()); |
|
|
|
setValueIfPresent(form2, "part2_1b", commonField.getFna_b1_c()); |
|
|
|
setValueIfPresent(form2, "part2_1c", commonField.getFna_b1_d()); |
|
|
|
setValueIfPresent(form2, "part2_1d", commonField.getFna_b1_e()); |
|
|
|
|
|
|
|
setValueIfPresent(form2, "part2_1c_a", commonField.getFna_b2_a()); |
|
|
|
setValueIfPresent(form2, "part2_1c_b", commonField.getFna_b2_b()); |
|
|
|
setValueIfPresent(form2, "part2_1c_c", commonField.getFna_b2_c()); |
|
|
|
setValueIfPresent(form2, "part2_1c_d", commonField.getFna_b2_d()); |
|
|
|
setValueIfPresent(form2, "part2_1c_e", commonField.getFna_b2_e()); |
|
|
|
setValueIfPresent(form2, "part2_1c_f", commonField.getFna_b2_f()); |
|
|
|
setValueIfPresent(form2, "part2_1c_g", commonField.getFna_b2_g()); |
|
|
|
|
|
|
|
setValueIfPresent(form2, "part2_1d_1", commonField.getFna_b1b_1()); |
|
|
|
setValueIfPresent(form2, "part2_1d_2", commonField.getFna_b1b_2()); |
|
|
|
setValueIfPresent(form2, "part2_1d_3", commonField.getFna_b1b_3()); |
|
|
|
|
|
|
|
setValueIfPresent(form2, "part2_1f", commonField.getFna_b1_f()); |
|
|
|
|
|
|
|
setValueIfPresent(form2, "part2_2_a", commonField.getFna_b2_a()); |
|
|
|
setValueIfPresent(form2, "part2_2_b", commonField.getFna_b2_b()); |
|
|
|
setValueIfPresent(form2, "part2_2_c", commonField.getFna_b2_c()); |
|
|
|
setValueIfPresent(form2, "part2_2_d", commonField.getFna_b2_d()); |
|
|
|
setValueIfPresent(form2, "part2_2_e", commonField.getFna_b2_e()); |
|
|
|
setValueIfPresent(form2, "part2_2_f", commonField.getFna_b2_f()); |
|
|
|
setValueIfPresent(form2, "part2_2_g", commonField.getFna_b2_g()); |
|
|
|
/* Page1 End */ |
|
|
|
/* Page2 Start */ |
|
|
|
setValueIfPresent(form2, "part3_3_5_2a", commonField.getFna_c3b_saving()); |
|
|
|
setValueIfPresent(form2, "part3_3_5_2b", commonField.getFna_c3b_investments()); |
|
|
|
setValueIfPresent(form2, "part3_3_5_2c", commonField.getFna_c3b_others()); |
|
|
|
setValueIfPresent(form2, "part3_3_5_2c_other", commonField.getFna_c3b_desc()); |
|
|
|
|
|
|
|
setValueIfPresent(form2, "part3_3_6_yes", commonField.getFna_c3c_yes()); |
|
|
|
setValueIfPresent(form2, "part3_3_6_no", commonField.getFna_c3c_no()); |
|
|
|
|
|
|
|
/* Page2 End */ |
|
|
|
/* Page3 Start */ |
|
|
|
setValueIfPresent(form2, "part3_4_4_1a", commonField.getFna_c3a_2_5()); |
|
|
|
setValueIfPresent(form2, "part3_4_4_1b", commonField.getFna_c3a_6_10()); |
|
|
|
setValueIfPresent(form2, "part3_4_4_1c", commonField.getFna_c3a_11_15()); |
|
|
|
setValueIfPresent(form2, "part3_4_4_1d", commonField.getFna_c3a_16_20()); |
|
|
|
setValueIfPresent(form2, "part3_4_4_1f", commonField.getFna_c3a_life()); |
|
|
|
if("Yes".equals(commonField.getFna_c3a_life()) || "Yes".equals(commonField.getFna_c3a_6_10()) |
|
|
|
|| "Yes".equals(commonField.getFna_c3a_11_15()) || "Yes".equals(commonField.getFna_c3a_16_20()) || "Yes".equals(commonField.getFna_c3a_life()) |
|
|
|
){ |
|
|
|
setValueIfPresent(form2, "part3_4_regular", "Yes"); |
|
|
|
} |
|
|
|
setValueIfPresent(form2, "part3_4_single_pay", commonField.getFna_c3a_single_pay()); |
|
|
|
|
|
|
|
/* Page3 End */ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@@ -688,7 +697,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
+ " fileId, " |
|
|
|
+ " created, " |
|
|
|
+ " modified, " |
|
|
|
+ " version " |
|
|
|
+ " version " |
|
|
|
+ " FROM filled_form " |
|
|
|
+ " WHERE deleted = FALSE " |
|
|
|
); |
|
|
@@ -798,13 +807,13 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
|
|
|
|
case "gender_m" -> { |
|
|
|
commonField.setGenderMale(fieldValue); |
|
|
|
if("on".equals(fieldValue)) { |
|
|
|
if("Yes".equals(fieldValue)) { |
|
|
|
commonField.setGender("M"); |
|
|
|
} |
|
|
|
} |
|
|
|
case "gender_f" -> { |
|
|
|
commonField.setGenderFemale(fieldValue); |
|
|
|
if("on".equals(fieldValue)) { |
|
|
|
if("Yes".equals(fieldValue)) { |
|
|
|
commonField.setGender("F"); |
|
|
|
} |
|
|
|
} |
|
|
@@ -825,19 +834,19 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
case "others_funds" -> commonField.setOthers_funds(fieldValue); |
|
|
|
case "others_funds_desc" -> commonField.setOthers_funds_desc(fieldValue); |
|
|
|
/* Page2 End */ |
|
|
|
/* Page3 Start */ |
|
|
|
/* Page9 Start */ |
|
|
|
case "fill_26_4" -> commonField.setFna_c1a_amount(fieldValue); |
|
|
|
/* Page3 End */ |
|
|
|
/* Page4 Start */ |
|
|
|
|
|
|
|
case "total_asset" -> commonField.setFna_c2a_amount(fieldValue); |
|
|
|
case "fill_56" -> commonField.setFna_c2b_amount(fieldValue); |
|
|
|
/* Page4 End */ |
|
|
|
/* Page9 End */ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/* Special logic Start */ |
|
|
|
//test the concat |
|
|
|
if( ("date_dd".equals(fieldName) || "date_mm".equals(fieldName) || "date_yyyy".equals(fieldName) ) |
|
|
|
&& commonField.getDdDateOfBirth() != null && commonField.getMmDateOfBirth() != null && commonField.getYyyyDateOfBirth() != null ){ |
|
|
|
&& StringUtils.isNotEmpty(commonField.getDdDateOfBirth()) && StringUtils.isNotEmpty(commonField.getMmDateOfBirth()) && StringUtils.isNotEmpty(commonField.getYyyyDateOfBirth()) ) { |
|
|
|
commonField.setDateOfBirth(commonField.getDdDateOfBirth() + "/" + commonField.getMmDateOfBirth() + "/" + commonField.getYyyyDateOfBirth()); |
|
|
|
} |
|
|
|
/* Special logic End */ |
|
|
@@ -850,11 +859,12 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
/* Page1 Start */ |
|
|
|
case "fna_a_name" -> commonField.setName(fieldValue); |
|
|
|
case "fna_a_birth" -> commonField.setDateOfBirth(fieldValue); |
|
|
|
case "fna_a_id_card" -> commonField.setIdCard(fieldValue); |
|
|
|
case "fna_a_occupation" -> commonField.setOccupation(fieldValue); |
|
|
|
|
|
|
|
case "fna_a_primary" -> commonField.setEduPri(fieldValue); |
|
|
|
case "fna_a_secondary" -> commonField.setEduSec(fieldValue); |
|
|
|
case "fna_a_tertiary" -> commonField.setEduTer(fieldValue); |
|
|
|
case "fna_a_tertiary" -> commonField.setEduPostSec(fieldValue); |
|
|
|
|
|
|
|
case "fna_a_marital" -> commonField.setMaritalStatus(fieldValue); |
|
|
|
case "fna_a_contact" -> commonField.setContactNo(fieldValue); |
|
|
@@ -926,6 +936,9 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
case "fna_c3b_policy" -> commonField.setFna_c3b_policy(fieldValue); |
|
|
|
case "fna_c3b_others" -> commonField.setFna_c3b_others(fieldValue); |
|
|
|
case "fna_c3b_desc" -> commonField.setFna_c3b_desc(fieldValue); |
|
|
|
|
|
|
|
case "fna_c3c_yes" -> commonField.setFna_c3c_yes(fieldValue); |
|
|
|
case "fna_c3c_no" -> commonField.setFna_c3c_no(fieldValue); |
|
|
|
/* Page5 End */ |
|
|
|
|
|
|
|
} |
|
|
@@ -948,7 +961,7 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
|
|
|
|
case "toggle_1" -> commonField.setEduPri(fieldValue); |
|
|
|
case "toggle_2" -> commonField.setEduSec(fieldValue); |
|
|
|
case "toggle_3" -> {commonField.setEduPostSec(fieldValue);commonField.setEduTer(fieldValue);} |
|
|
|
case "toggle_3" -> commonField.setEduPostSec(fieldValue); |
|
|
|
|
|
|
|
//case "fill_11" -> {commonField.setFna_c1a_amount(fieldValue);} //commonField.setAnnualIncome(fieldValue); |
|
|
|
case "fill_11" -> { |
|
|
@@ -989,8 +1002,11 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
/* Page3 Start */ |
|
|
|
case "toggle_91" -> commonField.setFna_b1_a(formCode); |
|
|
|
case "fill_1_4" -> commonField.setFna_b1_a_amount(formCode); |
|
|
|
case "fill_1_4b" -> commonField.setFna_b1_b(formCode); |
|
|
|
case "toggle_93" -> commonField.setFna_b1_d(formCode); |
|
|
|
case "fill_1_4b" -> commonField.setFna_b1a_4_amount(formCode); |
|
|
|
|
|
|
|
case "toggle_93" -> commonField.setFna_b1b_1(formCode); |
|
|
|
case "toggle_94" -> commonField.setFna_b1b_3(formCode); |
|
|
|
|
|
|
|
case "fill_1_4c" -> commonField.setFna_b1_d_year(formCode); |
|
|
|
case "fill_1_4d" -> commonField.setFna_b1_d_year(formCode); |
|
|
|
case "fill_1_4e" -> commonField.setFna_b1_d_amount(formCode); |
|
|
@@ -1010,12 +1026,15 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
case "toggle_4_3" -> commonField.setFna_c3a_16_20(formCode); |
|
|
|
case "toggle_5_2" -> commonField.setFna_c3a_20(formCode); |
|
|
|
case "toggle_6_2" -> commonField.setFna_c3a_life(fieldValue); |
|
|
|
case "toggle_6_2_sum" -> commonField.setFna_c3a_2_5(formCode); |
|
|
|
case "toggle_6_2_sum" -> commonField.setFna_c3a_single_pay(formCode); |
|
|
|
|
|
|
|
case "fill_98_04" -> commonField.setFna_a_retire(formCode); |
|
|
|
/* Page4 End */ |
|
|
|
/* Page5 Start */ |
|
|
|
case "toggle_1f" -> commonField.setFna_c3b_income(formCode); |
|
|
|
case "toggle_1g" -> commonField.setFna_c3b_saving(formCode); |
|
|
|
case "toggle_1h" -> commonField.setFna_c3b_policy(formCode); |
|
|
|
|
|
|
|
case "toggle_1f" -> {commonField.setFna_c3b_income(formCode); commonField.setFna_c3b_salary(formCode);} |
|
|
|
case "toggle_1g" -> {commonField.setFna_c3b_saving(formCode); commonField.setFna_c3b_investments(formCode);} |
|
|
|
//case "toggle_1h" -> commonField.setFna_c3b_policy(formCode); |
|
|
|
case "toggle_1i56" -> commonField.setFna_c3b_others(formCode); |
|
|
|
case "Text3" -> commonField.setFna_c3b_desc(formCode); |
|
|
|
|
|
|
@@ -1039,6 +1058,80 @@ public class PdfService extends AbstractBaseEntityService<Pdf, Long, PdfReposito |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if("MLFNA_EN".equals(formCode)){ |
|
|
|
switch (fieldName) { |
|
|
|
/* Page1 Start */ |
|
|
|
case "part1" -> commonField.setName(fieldValue); |
|
|
|
case "part2_1a" -> commonField.setFna_b1_a(fieldValue); |
|
|
|
case "part2_1a_amount" -> commonField.setFna_b1_a_amount(fieldValue); |
|
|
|
|
|
|
|
case "part2_1b" -> commonField.setFna_b1_c(fieldValue); |
|
|
|
|
|
|
|
case "part2_1c" -> commonField.setFna_b1_d(fieldValue); |
|
|
|
case "part2_1c_amount" -> commonField.setFna_b1_d_amount(fieldValue); |
|
|
|
|
|
|
|
case "part2_1d" -> commonField.setFna_b1_e(fieldValue); |
|
|
|
|
|
|
|
/* exported year? only can one way from FNA b1 d year |
|
|
|
case "part2_1c_a" -> commonField.setFna_b2_a(fieldValue); |
|
|
|
case "part2_1c_b" -> commonField.setFna_b2_b(fieldValue); |
|
|
|
case "part2_1c_c" -> commonField.setFna_b2_c(fieldValue); |
|
|
|
case "part2_1c_d" -> commonField.setFna_b2_d(fieldValue); |
|
|
|
case "part2_1c_e" -> commonField.setFna_b2_e(fieldValue); |
|
|
|
case "part2_1c_f" -> commonField.setFna_b2_f(fieldValue); |
|
|
|
case "part2_1c_g" -> commonField.setFna_b2_g(fieldValue); |
|
|
|
*/ |
|
|
|
|
|
|
|
case "part2_1d_1" -> commonField.setFna_b1b_1(fieldValue); |
|
|
|
case "part2_1d_2" -> commonField.setFna_b1b_2(fieldValue); |
|
|
|
case "part2_1d_3" -> commonField.setFna_b1b_3(fieldValue); |
|
|
|
|
|
|
|
case "part2_1e_desc" -> commonField.setFna_b1_b(fieldValue); |
|
|
|
|
|
|
|
case "part2_1f" -> commonField.setFna_b1_f(fieldValue); |
|
|
|
case "part2_1f_desc" -> commonField.setFna_b1_f_other(fieldValue); |
|
|
|
|
|
|
|
case "part2_2_a" -> commonField.setFna_b2_a(fieldValue); |
|
|
|
case "part2_2_b" -> commonField.setFna_b2_b(fieldValue); |
|
|
|
case "part2_2_c" -> commonField.setFna_b2_c(fieldValue); |
|
|
|
case "part2_2_d" -> commonField.setFna_b2_d(fieldValue); |
|
|
|
case "part2_2_e" -> commonField.setFna_b2_e(fieldValue); |
|
|
|
case "part2_2_f" -> commonField.setFna_b2_f(fieldValue); |
|
|
|
case "part2_2_g" -> commonField.setFna_b2_g(fieldValue); |
|
|
|
/* Page1 End */ |
|
|
|
/* Page2 Start */ |
|
|
|
case "part3_3_1" -> commonField.setFna_c1a_amount(fieldValue); //need to /7.78 |
|
|
|
case "part3_3_2" -> commonField.setFna_c1b_amount(fieldValue); //need to /7.78 |
|
|
|
|
|
|
|
case "part3_3_4" -> commonField.setFna_c2a_amount(fieldValue); //need to /7.78 |
|
|
|
|
|
|
|
case "part3_3_5_2a" -> commonField.setFna_c3b_saving(fieldValue); |
|
|
|
case "part3_3_5_2b" -> commonField.setFna_c3b_investments(fieldValue); |
|
|
|
case "part3_3_5_2c" -> commonField.setFna_c3b_others(fieldValue); |
|
|
|
case "part3_3_5_2c_other" -> commonField.setFna_c3b_desc(fieldValue); |
|
|
|
|
|
|
|
case "part3_3_6_yes" -> commonField.setFna_c3c_yes(fieldValue); |
|
|
|
case "part3_3_6_no" -> commonField.setFna_c3c_no(fieldValue); |
|
|
|
|
|
|
|
case "part3_3_6_2" -> commonField.setFna_c1c_3_amount(fieldValue); //monthly! |
|
|
|
|
|
|
|
/* Page2 End */ |
|
|
|
/* Page3 Start */ |
|
|
|
case "part3_4_4_1a" -> commonField.setFna_c3a_2_5(fieldValue); |
|
|
|
case "part3_4_4_1b" -> commonField.setFna_c3a_6_10(fieldValue); |
|
|
|
case "part3_4_4_1c" -> commonField.setFna_c3a_11_15(fieldValue); |
|
|
|
case "part3_4_4_1d" -> commonField.setFna_c3a_16_20(fieldValue); |
|
|
|
//case "part3_4_4_1e" -> commonField.setFna_c3a_life(fieldValue); |
|
|
|
case "part3_4_4_1f" -> commonField.setFna_c3a_life(fieldValue); |
|
|
|
|
|
|
|
case "part3_4_single_pay" -> commonField.setFna_c3a_single_pay(fieldValue); |
|
|
|
|
|
|
|
/* Page3 End */ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// |
|
|
|
|
|
|
|
//logger.info("end Field: " + field.getPartialName() + ", Value: " + field.getValueAsString()); |
|
|
|
// You can save this data to a database, or perform other operations |
|
|
|