Ejemplo n.º 1
0
  private Map<String, String> updateResumeMixInfo(Integer perId, String updateTable) {
    PerUser perUser = perUserEao.get(perId);
    if (perUser != null) {
      PerResumeBo vo;
      try {
        vo = perResumeEao.getResumeVo(perUser.getResId());
      } catch (Exception ex) {
        vo = null;
      }

      if (vo != null) {

        int degree = 0;
        String schoolName = "";
        String speciality = "";
        if (vo.getEducationInfoVoList() != null) {
          for (PerResumeBo.EducationInfoVo eduVo : vo.getEducationInfoVoList()) {
            if (eduVo != null && eduVo.getDegree() != null && eduVo.getDegree() > degree) {
              degree = eduVo.getDegree();
              schoolName = eduVo.getSchoolName();
              speciality = eduVo.getSpeciality();
            }
          }
        }

        ComReceiveAssistBo craVo = new ComReceiveAssistBo();
        if (vo.getWorkInfoVoList() != null && CollectionUtils.size(vo.getWorkInfoVoList()) > 0) {
          PerResumeBo.WorkInfoVo workVo = vo.getWorkInfoVoList().get(0);
          craVo.setLastPosName(workVo.getJobName());
          //                        craVo.setLastJobLocation(workVo.get); //个人简历无此数据
          craVo.setComName(workVo.getComName());
          craVo.setStart(workVo.getBegin());
          craVo.setEnd(workVo.getEnd());
        }

        craVo.setJobyearType(perUser.getJobyearType());
        craVo.setMobile(perUser.getMobile());
        if (vo.getIntentInfoVo() != null) {
          craVo.setSkill(vo.getIntentInfoVo().getProfessionSkill());
        }
        //                    craVo.setFileName();
        //                    craVo.setFilePath();

        // 计算年龄的公式修改为精确到年与搜索引擎匹配
        DateTime bDate = new DateTime(perUser.getBirthday());
        bDate = bDate.monthOfYear().setCopy(1).dayOfMonth().setCopy(1);
        DateTime nDate = DateTime.now();
        nDate = nDate.monthOfYear().setCopy(1).dayOfMonth().setCopy(2);
        Integer age = Years.yearsBetween(bDate, nDate).getYears();

        if (perUser.getResId() != null
            && perUser.getResId() > 0
            && StringUtils.isNotBlank(perUser.getUserName())) {
          getJdbcTemplateAction()
              .update(
                  "update "
                      + updateTable
                      + " set "
                      + "resume_id = ? , "
                      + "user_name=? , "
                      + "gender = ? , "
                      +
                      //                        "job_location = ? , " +
                      //                        "location = ? , " +
                      "age = ? , "
                      + "degree = ? , "
                      + "mix_info = ? , "
                      + "school_name = ? , "
                      + "speciality = ?, "
                      + "jobyear_type = ? "
                      + "where per_user_id = ?",
                  perUser.getResId(),
                  perUser.getUserName(),
                  perUser.getGender(),
                  //                            vo.getIntentInfoVo().getJobLocation(),
                  //                            "",
                  (age < 16 || age > 65) ? 16 : age,
                  degree,
                  (new Gson()).toJson(craVo),
                  schoolName,
                  speciality,
                  perUser.getJobyearType(),
                  perUser.getId());
        }

        Map<String, String> map = Maps.newHashMap();
        map.put("resumeId", String.valueOf(perUser.getResId()));
        map.put("userName", perUser.getUserName());
        map.put("gender", String.valueOf(perUser.getGender()));
        map.put("age", String.valueOf((age < 16 || age > 65) ? 16 : age));
        map.put("degree", String.valueOf(degree));
        map.put("mixInfo", (new Gson()).toJson(craVo));
        map.put("schoolName", schoolName);
        map.put("speciality", speciality);
        map.put("schoolName", schoolName);
        map.put("jobyearType", String.valueOf(perUser.getJobyearType()));

        return map;
      }
    }
    return null;
  }
Ejemplo n.º 2
0
  public void fillIrcReservePerInfo(IrcReserve ircReserve) {
    if (ircReserve != null && StringUtils.isBlank(ircReserve.getUserName())) {
      Integer perId = ircReserve.getUserId();
      Integer resId = ircReserve.getResId();

      try {
        Map<String, Object> perMap =
            getJdbcTemplate().queryForMap("SELECT * FROM per_user WHERE id=?", perId);

        String birthday = ObjectUtils.toString(perMap.get("birthday"));
        Integer age = 16;
        if (StringUtils.isNotBlank(birthday)) {
          age = Years.yearsBetween(new DateTime(birthday), DateTime.now()).getYears();
          age = (age < 16 || age > 65) ? 16 : age;
        }
        String userName = ObjectUtils.toString(perMap.get("userName"));
        Integer gender = NumberUtils.toInt(ObjectUtils.toString(perMap.get("gender")), 0);
        Integer jobyearType = NumberUtils.toInt(ObjectUtils.toString(perMap.get("jobyearType")), 0);
        String schoolName = "";
        int degree = 0;
        PerUser perUser = perUserEao.get(perId);
        if (perUser != null) {
          PerResumeBo vo;
          try {
            vo = perResumeEao.getResumeVo(perUser.getResId());
          } catch (Exception ex) {
            vo = null;
          }
          if (vo != null) {
            if (vo.getEducationInfoVoList() != null) {
              for (PerResumeBo.EducationInfoVo eduVo : vo.getEducationInfoVoList()) {
                if (eduVo != null && eduVo.getDegree() != null && eduVo.getDegree() > degree) {
                  degree = eduVo.getDegree();
                  schoolName = eduVo.getSchoolName();
                }
              }
            }
          }
        }

        ircReserve.setUserName(userName);
        ircReserve.setGender(gender);
        ircReserve.setAge(age);
        ircReserve.setDegree(degree);
        ircReserve.setSchoolName(schoolName);
        ircReserve.setJobyearType(jobyearType);

        getJdbcTemplateIrc()
            .update(
                "UPDATE irc_reserve SET "
                    + " user_name = ?,"
                    + " age = ?,"
                    + " gender=?,"
                    + " jobyear_type = ? "
                    + " WHERE "
                    + " res_id=? ",
                userName,
                age,
                gender,
                jobyearType,
                resId);

      } catch (Exception e) {
        // 不处理
      }
    }
  }
Ejemplo n.º 3
0
  public void fillBuyHistoryPerInfo(ComResumeBuyHistory comResumeBuyHistory) {
    if (comResumeBuyHistory != null && StringUtils.isBlank(comResumeBuyHistory.getSchoolName())) {
      Integer perId = comResumeBuyHistory.getPerUserId();
      Integer id = comResumeBuyHistory.getId();

      try {
        Map<String, Object> perMap =
            getJdbcTemplate().queryForMap("SELECT * FROM per_user WHERE id=?", perId);

        String birthday = ObjectUtils.toString(perMap.get("birthday"));
        Integer age = 16;
        if (StringUtils.isNotBlank(birthday)) {
          // 计算年龄的公司修改为精确到年与搜索引擎匹配
          DateTime bDate = new DateTime(birthday);
          bDate = bDate.monthOfYear().setCopy(1).dayOfMonth().setCopy(1);
          DateTime nDate = DateTime.now();
          nDate = nDate.monthOfYear().setCopy(1).dayOfMonth().setCopy(1);
          age = Years.yearsBetween(bDate, nDate).getYears();
          age = (age < 16 || age > 65) ? 16 : age;
        }
        Integer gender = NumberUtils.toInt(ObjectUtils.toString(perMap.get("gender")), 0);
        Integer jobyearType = NumberUtils.toInt(ObjectUtils.toString(perMap.get("jobyearType")), 0);
        String schoolName = "";
        String speciality = "";
        String genderStr = OptionMap.getValueByType(OptionMap.OptionType.OPT_GENDER, gender, null);

        PerUser perUser = perUserEao.get(perId);
        if (perUser != null) {
          PerResumeBo vo;
          try {
            vo = perResumeEao.getResumeVo(perUser.getResId());
          } catch (Exception ex) {
            vo = null;
          }
          if (vo != null) {
            int degree = 0;
            if (vo.getEducationInfoVoList() != null) {
              for (PerResumeBo.EducationInfoVo eduVo : vo.getEducationInfoVoList()) {
                if (eduVo != null && eduVo.getDegree() != null && eduVo.getDegree() > degree) {
                  degree = eduVo.getDegree();
                  schoolName = eduVo.getSchoolName();
                  speciality = eduVo.getSpeciality();
                }
              }
            }
          }
        }
        String degreeStr =
            OptionMap.getValueByType(OptionMap.OptionType.OPT_PER_DEGREE, gender, null);
        ;

        comResumeBuyHistory.setAge(age);
        comResumeBuyHistory.setGender(genderStr);
        comResumeBuyHistory.setDegree(degreeStr);
        comResumeBuyHistory.setSchoolName(schoolName);
        comResumeBuyHistory.setSpeciality(speciality);
        comResumeBuyHistory.setJobyear(jobyearType);

        getJdbcTemplate()
            .update(
                "UPDATE com_resume_buy_history SET "
                    + " age = ?,"
                    + " gender = ?,"
                    + " degree = ?,"
                    + " school_name = ? "
                    + " speciality = ? "
                    + " jobyear = ? "
                    + " WHERE "
                    + " id=? ",
                age,
                genderStr,
                degreeStr,
                schoolName,
                speciality,
                jobyearType,
                id);

      } catch (Exception e) {
        // 不处理
      }
    }
  }
Ejemplo n.º 4
0
  public PerResume fixDuplicateInfoListId(PerResume perResume) {
    if (perResume != null) {
      PerResumeBo perReusmeVo = new PerResumeBo(perResume);
      List<PerResumeBo.EducationInfoVo> educationInfoVoList = perReusmeVo.getEducationInfoVoList();
      if (CollectionUtils.isNotEmpty(educationInfoVoList)
          && CollectionUtils.size(educationInfoVoList) > 1) {
        for (int i = 0; i < educationInfoVoList.size(); i++) {
          PerResumeBo.EducationInfoVo vo = educationInfoVoList.get(i);
          vo.setId((long) i + 1);
          educationInfoVoList.set(i, vo);
        }
        perReusmeVo.setEducationInfoVoList(educationInfoVoList);
      }

      List<PerResumeBo.WorkInfoVo> workInfoVoList = perReusmeVo.getWorkInfoVoList();
      if (CollectionUtils.isNotEmpty(workInfoVoList) && CollectionUtils.size(workInfoVoList) > 1) {
        for (int i = 0; i < workInfoVoList.size(); i++) {
          PerResumeBo.WorkInfoVo vo = workInfoVoList.get(i);
          vo.setId((long) i + 1);
          workInfoVoList.set(i, vo);
        }
        perReusmeVo.setWorkInfoVoList(workInfoVoList);
      }

      List<PerResumeBo.AccessoryInfoVo> accessoryInfoVoList = perReusmeVo.getAccessoryInfoVoList();
      if (CollectionUtils.isNotEmpty(accessoryInfoVoList)
          && CollectionUtils.size(accessoryInfoVoList) > 1) {
        for (int i = 0; i < accessoryInfoVoList.size(); i++) {
          PerResumeBo.AccessoryInfoVo vo = accessoryInfoVoList.get(i);
          vo.setId((long) i + 1);
          accessoryInfoVoList.set(i, vo);
        }
        perReusmeVo.setAccessoryInfoVoList(accessoryInfoVoList);
      }

      List<PerResumeBo.CertificateInfoVo> certificateInfoVoList =
          perReusmeVo.getCertificateInfoVoList();
      if (CollectionUtils.isNotEmpty(certificateInfoVoList)
          && CollectionUtils.size(certificateInfoVoList) > 1) {
        for (int i = 0; i < certificateInfoVoList.size(); i++) {
          PerResumeBo.CertificateInfoVo vo = certificateInfoVoList.get(i);
          vo.setId((long) i + 1);
          certificateInfoVoList.set(i, vo);
        }
        perReusmeVo.setCertificateInfoVoList(certificateInfoVoList);
      }

      List<PerResumeBo.TrainInfoVo> trainInfoVoList = perReusmeVo.getTrainInfoVoList();
      if (CollectionUtils.isNotEmpty(trainInfoVoList)
          && CollectionUtils.size(trainInfoVoList) > 1) {
        for (int i = 0; i < trainInfoVoList.size(); i++) {
          PerResumeBo.TrainInfoVo vo = trainInfoVoList.get(i);
          vo.setId((long) i + 1);
          trainInfoVoList.set(i, vo);
        }
        perReusmeVo.setTrainInfoVoList(trainInfoVoList);
      }

      List<PerResumeBo.LanguageInfoVo> languageInfoVoList = perReusmeVo.getLanguageInfoVoList();
      if (CollectionUtils.isNotEmpty(languageInfoVoList)
          && CollectionUtils.size(languageInfoVoList) > 1) {
        for (int i = 0; i < languageInfoVoList.size(); i++) {
          PerResumeBo.LanguageInfoVo vo = languageInfoVoList.get(i);
          vo.setId((long) i + 1);
          languageInfoVoList.set(i, vo);
        }
        perReusmeVo.setLanguageInfoVoList(languageInfoVoList);
      }

      perResume = perReusmeVo.toModel();
    }
    return perResume;
  }