/** * 修复地区名称为地区代码(comstore) * * @param page */ public void fixComStoreJobLocationToCode(Page<ComStore> page) { if (page == null || CollectionUtils.isEmpty(page.getItems())) { return; } for (ComStore comStore : page.getItems()) { if (StringUtils.isNotBlank(comStore.getJobLocation())) { List<Integer> jobLocationList = Lists.newArrayList(); String[] jobLocationArr = comStore.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)) { comStore.setJobLocation(StringUtils.join(jobLocationList, ",")); } } } }
public void fillComStoreMixInfo(ComStore comStore) { if (comStore != null && StringUtils.isBlank(comStore.getMixInfo())) { Integer perId = comStore.getPerUserId(); try { Map<String, String> map = updateResumeMixInfo(perId, " com_store "); if (NumberUtils.toInt(map.get("resumeId"), 0) > 0 && map.get("userName") != null && StringUtils.isNotBlank(ObjectUtils.toString(map.get("userName")))) { comStore.setResumeId(NumberUtils.toInt(map.get("resumeId"), 0)); comStore.setUserName(map.get("userName")); comStore.setGender(NumberUtils.toInt(map.get("gender"), 0)); comStore.setAge(NumberUtils.toInt(map.get("age"), 0)); comStore.setDegree(NumberUtils.toInt(map.get("degree"), 0)); comStore.setMixInfo(map.get("mixInfo")); comStore.setSchoolName(map.get("schoolName")); comStore.setSpeciality(map.get("speciality")); comStore.setSchoolName(map.get("schoolName")); comStore.setJobyearType(NumberUtils.toInt(map.get("jobyearType"), 0)); } else { getJdbcTemplateAction() .update("UPDATE com_store SET mix_info = ? WHERE id=?", "{}", comStore.getId()); comStore.setMixInfo("{}"); } } catch (Exception ex) { // 不处理 } } }