com.hrs.controller.front.AddResumeController.java Source code

Java tutorial

Introduction

Here is the source code for com.hrs.controller.front.AddResumeController.java

Source

package com.hrs.controller.front;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hrs.common.MapTableArray;
import com.hrs.model.dto.addResume.HiddenAddResumeDTO;
import com.hrs.model.dto.dynamicForm.PostListDTO;
import com.hrs.model.dto.dynamicForm.SkillByKindListDTO;
import com.hrs.model.dto.dynamicForm.YearsListDTO;
import com.hrs.model.dto.newResume.ExperienceDTO;
import com.hrs.model.dto.newResume.LanguageProficiencyDTO;
import com.hrs.model.dto.newResume.MemberSkillKindDTO;
import com.hrs.model.dto.newResume.SumYearsDTO;
import com.hrs.model.dto.newResume.UIDateDTO;
import com.hrs.model.dto.newResume.YearsDTO;
import com.hrs.model.pojo.BasicInformation;
import com.hrs.model.pojo.ContactInformation;
import com.hrs.model.pojo.EducationalBackground;
import com.hrs.model.pojo.Experience;
import com.hrs.model.pojo.LanguageCertificates;
import com.hrs.model.pojo.LanguageProficiency;
import com.hrs.model.pojo.LoginUser;
import com.hrs.model.pojo.MemberDesiredPosition;
import com.hrs.model.pojo.ProjectExperience;
import com.hrs.model.pojo.SkillByKind;
import com.hrs.model.pojo.SkillKind;
import com.hrs.model.pojo.Years;

//import com.hrs.model.ContactInfo;

@Controller
public class AddResumeController extends ResumeController {

    List<LanguageCertificates> languageCertificates = new ArrayList<LanguageCertificates>();
    private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");

    @RequestMapping(value = "/protectionLaw")
    public String protectionLaw(HttpServletRequest req, HttpSession session, ModelMap modelMap) throws Exception {
        System.out.println("protectionLaw......");

        return "/front/protectionLaw";
    }

    @RequestMapping(value = "/addResume")
    public String addResume(HttpServletRequest req, HttpSession session, ModelMap modelMap) throws Exception {
        System.out.println("addResume......");
        LoginUser loginUser = (LoginUser) session.getAttribute("loginUser");
        BasicInformation basicInformation = new BasicInformation();

        basicInformation.setChName(loginUser.getUsername());
        logger.info("chName = " + basicInformation.getChName());

        ContactInformation contactInformation = new ContactInformation();
        contactInformation.setMobilePhone(loginUser.getLoginName());
        contactInformation.setMailingAddress(loginUser.geteMail());

        // UI select lists
        List<PostListDTO> posts = newResumeService.getPostList();
        List<YearsListDTO> yearsList = newResumeService.getYearsList();
        List<SkillKind> skillList = newResumeService.getSkillKindist();
        List<SkillByKindListDTO> skillByJavaList = newResumeService.getSkillByKindListBySkillKind(2);
        List<SkillByKindListDTO> skillByNetList = newResumeService.getSkillByKindListBySkillKind(1);
        List<SkillByKindListDTO> skilNonByKindList = newResumeService.getSkillByKindListBySkillKind(0);
        List<String> enableDateList = enableDateList();
        List<String> hinderTypeList = hinderTypeList();
        List<String> hinderLevelList = hinderLevelList();
        List<String> salaryRangeList = salaryRangeList();
        List<String> eduBgList = eduBgList();
        List<String> companySizeList = companySizeList();
        List<String> languageList = languageList();
        List<String> otherLanguageList = otherLanguageList();
        List<String> LanguageProficiencyList = LanguageProficiencyList();
        // postType
        List<String> postTypeLevelList = postTypeLevelList();
        List<String> postTypeByManageList = postTypeByManageList();
        List<String> postTypeBySalesList = postTypeBySalesList();
        List<String> postTypeByComputerList = postTypeByComputerList();
        List<String> postTypeByMachineList = postTypeByMachineList();
        List<String> postTypeByPurchaseList = postTypeByPurchaseList();
        List<String> postTypeByMedicalList = postTypeByMedicalList();
        List<String> postTypeByTvList = postTypeByTvList();
        List<String> postTypeByLegalList = postTypeByLegalList();
        List<String> postTypeByPreschoolList = postTypeByPreschoolList();
        List<String> postTypeByLifeList = postTypeByLifeList();
        List<String> postTypeByfinanceList = postTypeByfinanceList();
        List<String> postTypeBySellList = postTypeBySellList();
        List<String> postTypeByIcList = postTypeByIcList();
        List<String> postTypeByMaintainList = postTypeByMaintainList();
        List<String> postTypeByBuildList = postTypeByBuildList();
        List<String> postTypeByBiologicalList = postTypeByBiologicalList();
        List<String> postTypeByArtList = postTypeByArtList();
        List<String> postTypeByEduList = postTypeByEduList();
        List<String> postTypeByCosmetologyList = postTypeByCosmetologyList();
        List<String> postTypeByPoliceList = postTypeByPoliceList();

        // skills
        List<String> computerSkillList = computerSkillList();
        List<String> oaList = oaList();
        List<String> osList = osList();
        List<String> programList = programList();
        List<String> dbList = dbList();
        List<String> imageList = imageList();
        List<String> uiList = uiList();
        List<String> multimediaList = multimediaList();
        List<String> hardwareList = hardwareList();
        List<String> erpList = erpList();
        List<String> infoList = infoList();
        List<String> hardwareDevList = hardwareDevList();

        modelMap.addAttribute("postList", posts);
        modelMap.addAttribute("yearsList", yearsList);
        modelMap.addAttribute("skillList", skillList);
        modelMap.addAttribute("skilNonByKindList", skilNonByKindList);
        modelMap.addAttribute("skillByNetList", skillByNetList);
        modelMap.addAttribute("skillByJavaList", skillByJavaList);
        modelMap.addAttribute("languageList", languageList);
        modelMap.addAttribute("otherLanguageList", otherLanguageList);
        modelMap.addAttribute("LanguageProficiencyList", LanguageProficiencyList);
        modelMap.addAttribute("enableDateList", enableDateList);
        modelMap.addAttribute("eduBgList", eduBgList);
        modelMap.addAttribute("companySizeList", companySizeList);
        modelMap.addAttribute("hinderTypeList", hinderTypeList);
        modelMap.addAttribute("hinderLevelList", hinderLevelList);
        modelMap.addAttribute("salaryRangeList", salaryRangeList);
        // postType
        modelMap.addAttribute("postTypeLevelList", postTypeLevelList);
        modelMap.addAttribute("postTypeByManageList", postTypeByManageList);
        modelMap.addAttribute("postTypeBySalesList", postTypeBySalesList);
        modelMap.addAttribute("postTypeByComputerList", postTypeByComputerList);
        modelMap.addAttribute("postTypeByMachineList", postTypeByMachineList);
        modelMap.addAttribute("postTypeByPurchaseList", postTypeByPurchaseList);
        modelMap.addAttribute("postTypeByMedicalList", postTypeByMedicalList);
        modelMap.addAttribute("postTypeByTvList", postTypeByTvList);
        modelMap.addAttribute("postTypeByLegalList", postTypeByLegalList);
        modelMap.addAttribute("postTypeByPreschoolList", postTypeByPreschoolList);
        modelMap.addAttribute("postTypeByLifeList", postTypeByLifeList);
        modelMap.addAttribute("postTypeByfinanceList", postTypeByfinanceList);
        modelMap.addAttribute("postTypeBySellList", postTypeBySellList);
        modelMap.addAttribute("postTypeByIcList", postTypeByIcList);
        modelMap.addAttribute("postTypeByMaintainList", postTypeByMaintainList);
        modelMap.addAttribute("postTypeByBuildList", postTypeByBuildList);
        modelMap.addAttribute("postTypeByBiologicalList", postTypeByBiologicalList);
        modelMap.addAttribute("postTypeByArtList", postTypeByArtList);
        modelMap.addAttribute("postTypeByEduList", postTypeByEduList);
        modelMap.addAttribute("postTypeByCosmetologyList", postTypeByCosmetologyList);
        modelMap.addAttribute("postTypeByPoliceList", postTypeByPoliceList);

        // skills
        modelMap.addAttribute("computerSkillList", computerSkillList);
        modelMap.addAttribute("oaList", oaList);
        modelMap.addAttribute("osList", osList);
        modelMap.addAttribute("programList", programList);
        modelMap.addAttribute("dbList", dbList);
        modelMap.addAttribute("imageList", imageList);
        modelMap.addAttribute("uiList", uiList);
        modelMap.addAttribute("multimediaList", multimediaList);
        modelMap.addAttribute("hardwareList", hardwareList);
        modelMap.addAttribute("erpList", erpList);
        modelMap.addAttribute("infoList", infoList);
        modelMap.addAttribute("hardwareDevList", hardwareDevList);
        modelMap.addAttribute("basicInformation", basicInformation);
        modelMap.addAttribute("contactInformation", contactInformation);

        return "/front/addResume";
    }

    @RequestMapping(value = "/addResumeMultiModelBindResult")
    public String sampleMultiModelBindResult(@ModelAttribute("basicInformation") BasicInformation basicInformation,
            @ModelAttribute("educationalBackground1") EducationalBackground educationalBackground1,
            @ModelAttribute("educationalBackground2") EducationalBackground educationalBackground2,
            @ModelAttribute("hiddenAddResumeDTO") HiddenAddResumeDTO hiddenAddResumeDTO,
            @ModelAttribute("contactInformation") ContactInformation contactInfo,
            @ModelAttribute("experience") Experience experience,
            @ModelAttribute("languageProficiency") LanguageProficiency languageProficiency,
            @ModelAttribute("skillKind") SkillKind skillKind,
            @ModelAttribute("skillByKind") SkillByKind skillByKind,
            @ModelAttribute("sumYearsDTO") SumYearsDTO sumYearsDTO, HttpSession session, ModelMap modelMap)
            throws Exception {

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
        String vacanciesList;
        String licenseList, skillString = " ";
        Hashtable<String, Integer> yearsMap = MapTableArray.yearsMap();

        MapTableArray.skillKindMap();

        MapTableArray.skillKindByFrameworkMap();

        MapTableArray.skillKindByLanguageMap();

        MapTableArray.skillKindByWebServerMap();

        MapTableArray.skillNonKindByArcMap();

        MapTableArray.skillNonKindByDBMap();

        MapTableArray.skillNonKindByOtherMap();

        Hashtable<String, Integer> languageMap = MapTableArray.languageMap();

        Hashtable<String, Integer> otherLanguageMap = MapTableArray.otherLanguageMap();

        MapTableArray.vacanciesMap();

        Hashtable<String, Integer> skillOptionMap = MapTableArray.skillOptionMap();

        UIDateDTO uiDateDto = new UIDateDTO();

        List<Years> yearEntityList = new ArrayList<Years>();
        List<YearsDTO> yearsDtoList = new ArrayList<YearsDTO>();
        List<ExperienceDTO> expDtoList = new ArrayList<ExperienceDTO>();
        List<Experience> experienceList = new ArrayList<Experience>();
        List<ProjectExperience> projectExperienceList = null;
        List<MemberSkillKindDTO> memberSkillKindDtoList = new ArrayList<MemberSkillKindDTO>();
        List<LanguageProficiencyDTO> languageDtoList = new ArrayList<LanguageProficiencyDTO>();
        List<LanguageProficiency> languageEntityList = new ArrayList<LanguageProficiency>();
        List<MemberDesiredPosition> memberDesiredPositions = new ArrayList<MemberDesiredPosition>();

        try {

            // basic Information
            logger.info("enter basic Information");
            LoginUser user = (LoginUser) session.getAttribute("loginUser");
            logger.info("guid = " + user.getGuid());
            logger.info("user name = " + user.getUsername());

            basicInformation.setGuid(user.getGuid());
            basicInformation.setCreateUser("System");

            if (basicInformation.getVeteransTime() == null) {
                basicInformation.setVeteransTime(null);
                // uiDateDto.setVeteransTime(null);
            }

            // IdentityCategory
            if (hiddenAddResumeDTO.getSumHinder().equalsIgnoreCase("0,0")) {
                basicInformation.setHinder("?");
            } else {
                basicInformation.setHinder(hiddenAddResumeDTO.getSumHinder());
            }

            // ?
            vacanciesList = hiddenAddResumeDTO.getSumVacancies();
            basicInformation.setExpectedPost(vacanciesList);

            uiDateDto.setVeteransTime(basicInformation.getVeteransTime() == null ? null
                    : sdf.format(basicInformation.getVeteransTime()));
            uiDateDto.setBirthday(sdf.format(basicInformation.getBirthday()));

            // contact Information
            contactInfo.setCreateUser("System");
            // educationalBackground
            List<EducationalBackground> eduBgList = new ArrayList<EducationalBackground>();
            logger.info("enter EducationalBackground");
            // 
            logger.info("DuringSchoolBegin = " + educationalBackground1.getDuringSchoolBegin());
            educationalBackground1.setCreateUser("System");
            educationalBackground1.setEbId(1);
            eduBgList.add(educationalBackground1);
            // 
            educationalBackground2.setCreateUser("System");
            educationalBackground2.setEbId(2);
            eduBgList.add(educationalBackground2);
            uiDateDto.setFristDuringSchoolBegin(sdf.format(educationalBackground1.getDuringSchoolBegin()));
            uiDateDto.setFristDuringSchoolEnd(sdf.format(educationalBackground1.getDuringSchoolEnd()));
            uiDateDto.setSecondDuringSchoolBegin(sdf.format(educationalBackground2.getDuringSchoolBegin()));
            uiDateDto.setSecondDuringSchoolEnd(sdf.format(educationalBackground2.getDuringSchoolEnd()));

            Years yearEntity = new Years();
            YearsDTO yearDto = new YearsDTO();
            yearEntity = new Years();
            yearDto = new YearsDTO();
            yearEntity.setCreateUser("System");

            logger.info("enter years");
            if (sumYearsDTO.getSumManageYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumManagePost()),
                        sumYearsDTO.getSumManageYears(), sumYearsDTO.getSumManagePost(),
                        sumYearsDTO.getSumManageYears() + "");
            }

            if (sumYearsDTO.getSumSalesYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumSalesPost()),
                        sumYearsDTO.getSumSalesYears(), sumYearsDTO.getSumSalesPost(),
                        sumYearsDTO.getSumSalesYears() + "");
            }

            if (sumYearsDTO.getSumComputerYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumComputerPost()),
                        sumYearsDTO.getSumComputerYears(), sumYearsDTO.getSumComputerPost(),
                        sumYearsDTO.getSumComputerYears() + "");
            }

            if (sumYearsDTO.getSumMachineYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumMachinePost()),
                        sumYearsDTO.getSumMachineYears(), sumYearsDTO.getSumMachinePost(),
                        sumYearsDTO.getSumMachineYears() + "");
            }

            if (sumYearsDTO.getSumPurchaseYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumPurchasePost()),
                        sumYearsDTO.getSumPurchaseYears(), sumYearsDTO.getSumPurchasePost(),
                        sumYearsDTO.getSumPurchaseYears() + "");
            }

            if (sumYearsDTO.getSumMedicalYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumMedicalPost()),
                        sumYearsDTO.getSumMedicalYears(), sumYearsDTO.getSumMedicalPost(),
                        sumYearsDTO.getSumMedicalYears() + "");
            }

            if (sumYearsDTO.getSumTvYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumTvPost()),
                        sumYearsDTO.getSumTvYears(), sumYearsDTO.getSumTvPost(), sumYearsDTO.getSumTvYears() + "");
            }

            if (sumYearsDTO.getSumLegalYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumLegalPost()),
                        sumYearsDTO.getSumLegalYears(), sumYearsDTO.getSumLegalPost(),
                        sumYearsDTO.getSumLegalYears() + "");
            }

            if (sumYearsDTO.getSumPreschoolYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumPreschoolPost()),
                        sumYearsDTO.getSumPreschoolYears(), sumYearsDTO.getSumPreschoolPost(),
                        sumYearsDTO.getSumPreschoolYears() + "");
            }

            if (sumYearsDTO.getSumfinanceYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumfinancePost()),
                        sumYearsDTO.getSumfinanceYears(), sumYearsDTO.getSumfinancePost(),
                        sumYearsDTO.getSumfinanceYears() + "");
            }

            if (sumYearsDTO.getSumSellYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumSellPost()),
                        sumYearsDTO.getSumSellYears(), sumYearsDTO.getSumSellPost(),
                        sumYearsDTO.getSumSellYears() + "");
            }

            if (sumYearsDTO.getSumIcYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumIcPost()),
                        sumYearsDTO.getSumIcYears(), sumYearsDTO.getSumIcPost(), sumYearsDTO.getSumIcYears() + "");
            }

            if (sumYearsDTO.getSumMaintainYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumMaintainPost()),
                        sumYearsDTO.getSumMaintainYears(), sumYearsDTO.getSumMaintainPost(),
                        sumYearsDTO.getSumMaintainYears() + "");
            }

            if (sumYearsDTO.getSumBuildYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumBuildPost()),
                        sumYearsDTO.getSumBuildYears(), sumYearsDTO.getSumBuildPost(),
                        sumYearsDTO.getSumBuildYears() + "");
            }

            if (sumYearsDTO.getSumBiologicalYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumBiologicalPost()),
                        sumYearsDTO.getSumBiologicalYears(), sumYearsDTO.getSumBiologicalPost(),
                        sumYearsDTO.getSumBiologicalYears() + "");
            }

            if (sumYearsDTO.getSumArtYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumArtPost()),
                        sumYearsDTO.getSumArtYears(), sumYearsDTO.getSumArtPost(),
                        sumYearsDTO.getSumArtYears() + "");
            }

            if (sumYearsDTO.getSumEduYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumEduPost()),
                        sumYearsDTO.getSumEduYears(), sumYearsDTO.getSumEduPost(),
                        sumYearsDTO.getSumEduYears() + "");
            }

            if (sumYearsDTO.getSumCosmetologyYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumCosmetologyPost()),
                        sumYearsDTO.getSumCosmetologyYears(), sumYearsDTO.getSumCosmetologyPost(),
                        sumYearsDTO.getSumCosmetologyYears() + "");
            }

            if (sumYearsDTO.getSumPoliceYears() != 0) {

                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumPolicePost()),
                        sumYearsDTO.getSumPoliceYears(), sumYearsDTO.getSumPolicePost(),
                        sumYearsDTO.getSumPoliceYears() + "");
            }

            if (sumYearsDTO.getSumLifeYears() != 0) {
                yearEntityMerge(yearEntity, yearDto, yearsMap.get(sumYearsDTO.getSumLifePost()),
                        sumYearsDTO.getSumLifeYears(), sumYearsDTO.getSumLifePost(),
                        sumYearsDTO.getSumLifeYears() + "");
            }

            yearEntityList.add(yearEntity);
            yearsDtoList.add(yearDto);

            // Experience
            logger.info("enter Experience");
            if (StringUtils.isNotEmpty(hiddenAddResumeDTO.getSumExperience())) {
                String[] exp = hiddenAddResumeDTO.getSumExperience().split(";");

                for (String expString : exp) {
                    logger.info("Experience = " + expString);
                    Experience expEntity = new Experience();
                    ExperienceDTO expDto = new ExperienceDTO();
                    String[] temp = expString.split(",");

                    expEntity.setCompanyName(temp[0]);
                    expEntity.setIndustrySectors(temp[1]);
                    expEntity.setCompanyScale(temp[2]);
                    expEntity.setWorkPlace(temp[3]);
                    expEntity.setPost(temp[4]);
                    expEntity.setServicePeriodBegin(sdf.parse(temp[5]));
                    expEntity.setServicePeriodEnd(sdf.parse(temp[6]));
                    expEntity.setAverageMonthlySalary(Integer.valueOf(temp[7]));
                    expEntity.setTotalAnnualSalary(Integer.valueOf(temp[8]));
                    expEntity.setWorkContent(temp[9]);
                    expEntity.setPostYears(Integer.valueOf(temp[10]));
                    expEntity.setCreateUser("System");
                    experienceList.add(expEntity);
                    // UI
                    expDto.setCompanyName(temp[0]);
                    expDto.setIndustrySectors(temp[1]);
                    expDto.setCompanyScale(temp[2]);
                    expDto.setWorkPlace(temp[3]);
                    expDto.setPost(temp[4]);
                    expDto.setServicePeriodBegin(sdf.format(sdf.parse(temp[5])));
                    expDto.setServicePeriodEnd(sdf.format(sdf.parse(temp[6])));
                    expDto.setAverageMonthlySalary(Integer.valueOf(temp[7]));
                    expDto.setTotalAnnualSalary(Integer.valueOf(temp[8]));
                    expDto.setWorkContent(temp[9]);

                    expDtoList.add(expDto);
                }
            }
            logger.info("enter Project Experience");
            if (StringUtils.isNotEmpty(hiddenAddResumeDTO.getSumProject())) {
                projectExperienceList = getProjectExperienceList(hiddenAddResumeDTO.getSumProject());
            }
            logger.info("enter Skills");
            logger.info("SumSkills = " + hiddenAddResumeDTO.getSumSkills());
            /*
             * String[] skillKindString =
             * hiddenAddResumeDTO.getSkillOption().split( ",");
             * 
             * for (int i = 0; i < skillKindString.length; i++) {
             * MemberSkillKindDTO memberSkillKindDto = new MemberSkillKindDTO();
             * 
             * // UI if (!skillOptionMap.containsKey(skillKindString[i])) { if
             * (i == skillKindString.length - 1) {
             * memberSkillKindDto.setSkillKind(skillKindString[i]); skillString
             * += skillKindString[i]; } else {
             * memberSkillKindDto.setSkillKind(skillKindString[i] + ",");
             * skillString += skillKindString[i] + ","; }
             * 
             * memberSkillKindDtoList.add(memberSkillKindDto); } }
             */
            basicInformation.setSkill(hiddenAddResumeDTO.getSumSkills());

            String[] languages = null;
            logger.info("enter languages");
            if (StringUtils.isNotEmpty(hiddenAddResumeDTO.getSumlanguage())) {
                languages = hiddenAddResumeDTO.getSumlanguage().split(";");

                for (String language : languages) {
                    logger.info("languages = " + language);
                    LanguageProficiency languageEntity = new LanguageProficiency();
                    LanguageProficiencyDTO languageDto = new LanguageProficiencyDTO();
                    languageCertificates = new ArrayList<LanguageCertificates>();

                    String[] temp = null;
                    if (!StringUtils.trimToEmpty(language).isEmpty()) {
                        temp = language.split(",");

                        languageEntity.setLanguages(languageMap.get(temp[0]));

                        languageEntity.setListen(!StringUtils.trimToEmpty(temp[1]).isEmpty() ? temp[1] : "");

                        languageEntity.setSay(!StringUtils.trimToEmpty(temp[2]).isEmpty() ? temp[2] : "");

                        languageEntity.setReading(!StringUtils.trimToEmpty(temp[3]).isEmpty() ? temp[3] : "");

                        languageEntity.setWrite(!StringUtils.trimToEmpty(temp[4]).isEmpty() ? temp[4] : "");

                        logger.info("temp length = " + temp.length);

                        if (temp[0].equals("") || temp[0].equals("")) {
                            insertCertificatesEntity(temp);
                        }
                    }

                    languageEntity.setCreateUser("System");
                    languageEntityList.add(languageEntity);
                    // UI
                    String certificate = " ", fraction = " ";
                    languageDto.setLanguageType(temp[0]);
                    languageDto.setListen(temp[1]);
                    languageDto.setSay(temp[2]);
                    languageDto.setReading(temp[3]);
                    languageDto.setWrite(temp[4]);
                    if (temp[0].equals("") || temp[0].equals("")) {
                        for (int i = 5; i < temp.length; i++) {
                            if (i % 2 == 1) {
                                certificate = !StringUtils.trimToEmpty(temp[i]).isEmpty()
                                        ? certificate + temp[i] + " "
                                        : "";
                            } else {
                                fraction = !StringUtils.trimToEmpty(temp[i]).isEmpty() ? fraction + temp[i] + " "
                                        : "";
                            }
                        }
                        languageDto.setCertificate(certificate);
                        languageDto.setFraction(fraction);
                    }

                    languageDto.setLocal(false);
                    languageDtoList.add(languageDto);
                }
            }
            String[] otherLanguages = hiddenAddResumeDTO.getSumOtherlanguage().split(";");

            for (String otherLanguage : otherLanguages) {
                logger.info("otherLanguages = " + otherLanguage);
                LanguageProficiency languageEntity = new LanguageProficiency();
                LanguageProficiencyDTO languageDto = new LanguageProficiencyDTO();
                String[] temp = otherLanguage.split(",");

                languageEntity.setLanguages(otherLanguageMap.get(temp[0]));
                languageEntity.setListen(temp[1]);
                languageEntity.setCreateUser("System");
                languageEntityList.add(languageEntity);
                // UI
                languageDto.setLanguageType(temp[0]);
                languageDto.setListen(temp[1]);
                languageDto.setLocal(true);
                languageDtoList.add(languageDto);
            }

            licenseList = hiddenAddResumeDTO.getSumLicense();
            basicInformation.setLicense(licenseList);

            if (StringUtils.isNotEmpty(hiddenAddResumeDTO.getSumExperience())) {
                newResumeService.insertResume(basicInformation, contactInfo, eduBgList, yearEntityList,
                        experienceList, projectExperienceList, languageEntityList, languageCertificates);
            } else {
                newResumeService.insertResume(basicInformation, contactInfo, eduBgList, null, null,
                        projectExperienceList, languageEntityList, languageCertificates);
            }

            modelMap.addAttribute("basicInformation", basicInformation);
            modelMap.addAttribute("contactInfo", contactInfo);
            modelMap.addAttribute("educationalBackground1", educationalBackground1);
            modelMap.addAttribute("educationalBackground2", educationalBackground2);
            modelMap.addAttribute("yearsDtoList", yearsDtoList);
            modelMap.addAttribute("expDtoList", expDtoList);
            modelMap.addAttribute("projectExperienceList", projectExperienceList);
            modelMap.addAttribute("languageDtoList", languageDtoList);
            modelMap.addAttribute("memberSkillKindDtoList", memberSkillKindDtoList);
            modelMap.addAttribute("UIDateDTO", uiDateDto);
            modelMap.addAttribute("vacanciesList", vacanciesList);
            modelMap.addAttribute("licenseList", licenseList);
        } catch (Exception ex) {
            logger.info(ex.toString());
        }
        logger.info("this is end....");
        return "/front/addResumeSuccess";
    }

    public void insertCertificatesEntity(String temp[]) {
        LanguageCertificates certificatesEntity = new LanguageCertificates();
        for (int i = 5; i < temp.length; i++) {
            logger.info("i=" + i);

            if (i % 2 == 1) {
                certificatesEntity = new LanguageCertificates();
                certificatesEntity.setName(temp[i]);
            } else {
                certificatesEntity.setFraction(temp[i]);
                languageCertificates.add(certificatesEntity);
            }
        }

        for (LanguageCertificates tmp : languageCertificates) {
            logger.info("certificates name = " + tmp.getName());
            logger.info("certificates Fraction = " + tmp.getFraction());
        }
    }

    public void yearEntityMerge(Years yearEntity, YearsDTO yearDto, int val1, int val2, String val3, String val4) {
        yearEntity.setPost(val1);
        yearEntity.setYears(val2);
        yearDto.setPost(val3);
        yearDto.setYears(val4);
    }

    public List<LanguageCertificates> getLanguageCertificates() {
        return languageCertificates;
    }

    public void setLanguageCertificates(List<LanguageCertificates> languageCertificates) {
        this.languageCertificates = languageCertificates;
    }

    private List<ProjectExperience> getProjectExperienceList(String sumProject) throws Exception {
        List<ProjectExperience> projectExperienceList = new ArrayList<ProjectExperience>();
        String[] allProject = sumProject.split("~~~");
        for (String oneProject : allProject) {
            projectExperienceList.add(getProjectExperience(oneProject));
        }
        return projectExperienceList;
    }

    private ProjectExperience getProjectExperience(String oneProject) throws Exception {
        ProjectExperience projectExperience = new ProjectExperience();
        String[] allColumn = oneProject.split("---");
        projectExperience.setCustomerProjectName(allColumn[0]);
        projectExperience.setParticipationDuringBegin(sdf.parse(allColumn[1]));
        projectExperience
                .setParticipationDuringEnd(StringUtils.isBlank(allColumn[2]) ? null : sdf.parse(allColumn[2]));
        projectExperience.setProjectRoles(allColumn[3]);
        projectExperience.setWorkContent(allColumn[4]);
        projectExperience.setTechnologyAndEnvironment(allColumn[5]);
        return projectExperience;
    }
}