예제 #1
0
 /**
  * 修复地区名称为地区代码 (comInterview)
  *
  * @param page
  */
 public void fixComInterviewJobLocationToCode(Page<ComInterview> page) {
   if (page == null || CollectionUtils.isEmpty(page.getItems())) {
     return;
   }
   for (ComInterview comInterview : page.getItems()) {
     if (StringUtils.isNotBlank(comInterview.getJobLocation())) {
       List<Integer> jobLocationList = Lists.newArrayList();
       String[] jobLocationArr = comInterview.getJobLocation().split(",");
       for (String location : jobLocationArr) {
         Integer code = OptionMap.getCityCodeByAddr(location);
         if (code != null && code > 0 && !NumberUtils.isNumber(location)) {
           jobLocationList.add(code);
         }
       }
       if (CollectionUtils.isNotEmpty(jobLocationList)) {
         comInterview.setJobLocation(StringUtils.join(jobLocationList, ","));
       }
     }
   }
 }