1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036 |
- package com.hz.employmentsite.services.impl.jobUserManager;
- import com.github.pagehelper.PageHelper;
- import com.github.pagehelper.PageInfo;
- import com.hz.employmentsite.filter.exception.BaseException;
- import com.hz.employmentsite.mapper.*;
- import com.hz.employmentsite.mapper.cquery.JobHuntCQuery;
- import com.hz.employmentsite.mapper.cquery.JobUserCQuery;
- import com.hz.employmentsite.mapper.cquery.JobUserServiceCQuery;
- import com.hz.employmentsite.mapper.cquery.LabelCQuery;
- import com.hz.employmentsite.model.*;
- import com.hz.employmentsite.services.impl.system.CityAreaImpl;
- import com.hz.employmentsite.services.service.AccountService;
- import com.hz.employmentsite.services.service.jobUserManager.HonorService;
- import com.hz.employmentsite.services.service.jobUserManager.JobUserService;
- import com.hz.employmentsite.services.service.jobUserManager.JobUserServiceService;
- import com.hz.employmentsite.services.service.system.DictionaryService;
- import com.hz.employmentsite.util.*;
- import com.hz.employmentsite.util.ip.IpUtils;
- import com.hz.employmentsite.vo.dataMap.JobUserMapVo;
- import com.hz.employmentsite.vo.jobUserManager.ClaimJobUserVo;
- import com.hz.employmentsite.vo.jobUserManager.JobHuntVo;
- import com.hz.employmentsite.vo.jobUserManager.JobUserServiceVo;
- import com.hz.employmentsite.vo.jobUserManager.JobUserVo;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import javax.servlet.http.HttpServletRequest;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.*;
- import java.util.stream.Collectors;
- @Service("JobUserService")
- public class JobUserServiceImpl implements JobUserService {
- @Autowired
- private JobUserCQuery jobUserCQuery;
- @Autowired
- private StringUtils stringUtils;
- @Autowired
- private DateUtils dateUtils;
- @Autowired
- private DesUtils desUtils;
- @Autowired
- private CalculateUtils calculateUtils;
- @Autowired
- private RegexUtils regexUtils;
- @Autowired
- private DictionaryService dictionaryService;
- @Autowired
- private PcEducationMapper pcEducationMapper;
- @Autowired
- private PcJobuserMapper pcJobuserMapper;
- @Autowired
- private PcExperienceMapper pcExperienceMapper;
- @Autowired
- private PcJobhuntMapper pcJobhuntMapper;
- @Autowired
- private PcPostMapper pcPostMapper;
- @Autowired
- private PcSiteUserMapper pcSiteUserMapper;
- @Autowired
- private PcSiteMapper pcSiteMapper;
- @Autowired
- private PcLabelJobuserMapper pcLabelJobuserMapper;
- @Autowired
- private PcOccupationalMapper pcOccupationalMapper;
- @Autowired
- private AreaCodeMapper areaCodeMapper;
- @Autowired
- private LabelCQuery labelCQuery;
- @Autowired
- private JobHuntCQuery jobHuntCQuery;
- @Autowired
- private JobUserServiceService jobUserServiceService;
- @Autowired
- private JobUserServiceCQuery jobUserServiceCQuery;
- @Autowired
- private AccountService accountService;
- @Autowired
- private SysLogMapper sysLogMapper;
- @Autowired
- private CityAreaImpl cityAreaImpl;
- @Autowired
- private HonorService honorService;
- @Autowired
- private PcSigninMapper pcSigninMapper;
- @Override
- public PageInfo<JobUserVo> getList(Integer pageIndex, Integer pageSize,
- List<String> jobUserIDList, String name,
- String siteId, String jobStatus,
- Integer sexId, Integer educationTypeId,
- Integer emphasisTypeId, String createUserId,
- String workTime, String loginUserID,
- String regionCode, Date startDate,
- Date endDate, String createUserName) {
- String curLoginUserSiteID = "";
- if (!stringUtils.IsNullOrEmpty(loginUserID)) {
- PcSiteUserExample siteUserExp = new PcSiteUserExample();
- siteUserExp.or().andUserIDEqualTo(loginUserID);
- curLoginUserSiteID = pcSiteUserMapper.selectByExample(siteUserExp).get(0).getSiteID();
- }
- PageHelper.startPage(pageIndex, pageSize);
- List<JobUserVo> list = jobUserCQuery.selectJobUserList(stringUtils.ListToInSql(jobUserIDList), name, siteId, jobStatus, sexId,
- educationTypeId, emphasisTypeId, createUserId, workTime,
- curLoginUserSiteID, regionCode, startDate, endDate, false,
- createUserName);
- // 信息脱敏
- list.forEach(item -> {
- item.setUserMobile(calculateUtils.maskMobile(desUtils.decoderText(item.getUserMobile())));
- String idNumber = desUtils.decoderText(item.getIdentityNumber());
- item.setIdentityNumber(idNumber);
- item.setAge(dateUtils.calculateAge(dateUtils.dateToStr(item.getBirthDay())));
- });
- PageInfo<JobUserVo> result = new PageInfo(list);
- return result;
- }
- @Override
- public PageInfo<JobUserVo> getDataList(Integer page, Integer rows,String jobUserName) {
- PageHelper.startPage(page,rows);
- List<JobUserVo> resultList = new ArrayList<>();
- List<JobUserVo> dataList = jobUserCQuery.getJobUserDataList(jobUserName);
- for (JobUserVo curDataBaseItem: dataList) {
- for(JobUserVo curJobUserItem : resultList){
- if(curJobUserItem.getName().equals(curDataBaseItem.getName())){
- PcJobuserExample jobuserExp = new PcJobuserExample();
- jobuserExp.or().andJobuserIDEqualTo(curJobUserItem.getJobUserID());
- var curJobUser = pcJobuserMapper.selectByExample(jobuserExp).get(0);
- curJobUserItem.setName(curJobUser.getName()+desUtils.decoderText(curJobUser.getUserMobile()).substring(7,11));
- curDataBaseItem.setName(curDataBaseItem.getName()+desUtils.decoderText(curDataBaseItem.getUserMobile()).substring(7,11));
- }
- }
- resultList.add(curDataBaseItem);
- }
- PageInfo<JobUserVo> result = new PageInfo(resultList);
- return result;
- //var dataList = getList(1, 99999, null, null, null, null, null, null, null, null, null, null, null, null, null).getList();
- //for (var item: dataList) {
- // SelectProps itemResult = new SelectProps();
- // itemResult.setText(item.getName());
- // itemResult.setValue(item.getJobUserID());
- // for(SelectProps curProp : dataResult){
- // if(curProp.getText().equals(item.getName())){
- // PcJobuserExample jobuserExp = new PcJobuserExample();
- // jobuserExp.or().andJobuserIDEqualTo(curProp.getValue());
- // var curJobUser = pcJobuserMapper.selectByExample(jobuserExp).get(0);
- // curProp.setText(curJobUser.getName()+desUtils.decoderText(curJobUser.getUserMobile()).substring(7,11));
- // itemResult.setText(item.getName()+item.getUserMobile().substring(7,11));
- // }
- // }
- // dataResult.add(itemResult);
- //}
- //return dataResult;
- }
- @Override
- public int setJobUserDes() {
- List<PcJobuser> list1 = jobUserCQuery.getJobUserIdentityNumber();
- if(list1.size()>0){
- for (var item: list1) {
- item.setIdentityNumber(desUtils.encoderText(item.getIdentityNumber()));
- pcJobuserMapper.updateByPrimaryKey(item);
- }
- }
- List<PcJobuser> list2 = jobUserCQuery.getJobUserUserMobile();
- if(list2.size()>0){
- for (var item: list2) {
- item.setUserMobile(desUtils.encoderText(item.getUserMobile()));
- pcJobuserMapper.updateByPrimaryKey(item);
- }
- }
- return list1.size() + list2.size();
- }
- @Override
- public JobUserVo getDataById(String id,boolean isAllJobUser) {
- if (stringUtils.IsNullOrEmpty(id)) {
- return null;
- }
- JobUserVo data = jobUserCQuery.selectJobUserList(stringUtils.ListToInSql(Arrays.asList(id)), null, null, null, null, null, null, null, null,null,null,null,null,isAllJobUser, null).stream().findFirst().orElse(null);
- if(data!=null){
- data.listLabel = labelCQuery.getUserLabelList(id);
- data.setAge(calculateUtils.calculateAge(desUtils.decoderText(data.getIdentityNumber())));
- }
- return data;
- }
- @Override
- public List<PcEducation> getJobUserEducationList(String jobuserID,boolean isAllJobUser) {
- PcEducationExample exp = new PcEducationExample();
- exp.setOrderByClause("SchoolTime DESC");
- exp.or().andJobuserIDEqualTo(jobuserID);
- if(isAllJobUser) exp.or().andJobuserIDEqualTo("AllJobUser");
- List<PcEducation> educationList = pcEducationMapper.selectByExample(exp);
- return educationList;
- }
- @Override
- public List<PcExperience> getJobUserExperienceList(String jobuserID,boolean isAllJobUser) {
- PcExperienceExample exp = new PcExperienceExample();
- exp.setOrderByClause("StartTime DESC");
- exp.or().andJobuserIDEqualTo(jobuserID);
- if(isAllJobUser) exp.or().andJobuserIDEqualTo("AllJobUser");
- List<PcExperience> experienceList = pcExperienceMapper.selectByExample(exp);
- return experienceList;
- }
- @Override
- public List<PcPost> getUserHuntList(String jobuserID) {
- PcJobhuntExample huntExp = new PcJobhuntExample();
- PcJobhuntExample.Criteria huntCro = huntExp.or();
- huntCro.andJobUserIDEqualTo(jobuserID);
- List<PcJobhunt> jobHuntList = pcJobhuntMapper.selectByExample(huntExp);
- List<String> professionIDList = new ArrayList<>();
- if (jobHuntList.size()>0){
- jobHuntList.stream().forEach(item->{
- professionIDList.add(item.getProfessionID());
- });
- PcPostExample postExp = new PcPostExample();
- PcPostExample.Criteria postCro = postExp.or();
- postCro.andPostIDIn(professionIDList);
- List<PcPost> curPostList = pcPostMapper.selectByExample(postExp);
- return curPostList;
- }else{
- return null;
- }
- }
- private int deleteEducation(List<String> ids) {
- int educationRows = 0;
- PcEducationExample expEducation = new PcEducationExample();
- PcEducationExample.Criteria croEducation = expEducation.or();
- croEducation.andJobuserIDIn(ids);
- educationRows = pcEducationMapper.deleteByExample(expEducation);
- return educationRows;
- }
- private int deleteExperience(List<String> ids) {
- int experienceRows = 0;
- PcExperienceExample expExperi = new PcExperienceExample();
- PcExperienceExample.Criteria croExperi = expExperi.or();
- croExperi.andJobuserIDIn(ids);
- experienceRows = pcExperienceMapper.deleteByExample(expExperi);
- return experienceRows;
- }
- @Override
- public int delete(HttpServletRequest request, List<String> ids) {
- deleteEducation(ids);
- deleteExperience(ids);
- int result = 0;
- String delInfo = "删除求职人员:";
- for(String curJobUserID: ids){
- PcJobhuntExample jobHuntExample = new PcJobhuntExample();
- jobHuntExample.or().andJobUserIDEqualTo(curJobUserID);
- var curJobUserHuntList = pcJobhuntMapper.selectByExample(jobHuntExample).stream().toList();
- if( curJobUserHuntList != null && curJobUserHuntList.size()>0){
- throw new BaseException("10004","所选求职人员已有关联的求职意向,不允许删除!");
- }
- PcSigninExample pcSigninExample = new PcSigninExample();
- pcSigninExample.or().andJobuserIDEqualTo(curJobUserID);
- List<PcSignin> pcSignins = pcSigninMapper.selectByExample(pcSigninExample).stream().toList();
- if (pcSignins != null && pcSignins.size() > 0) {
- throw new BaseException("10004","所选企业已有关联的外出工作走访记录信息,暂时无法删除!");
- }
- PcJobuser pcJobuser = pcJobuserMapper.selectByPrimaryKey(curJobUserID);
- int count = pcJobuserMapper.deleteByPrimaryKey(curJobUserID);
- if(count>0){
- // 记录被删除的求职人员信息
- delInfo += pcJobuser.getName() + ",";
- // 删除求职人员标签
- PcLabelJobuserExample labelEmp = new PcLabelJobuserExample();
- labelEmp.or().andJobuserIDEqualTo(curJobUserID);
- pcLabelJobuserMapper.deleteByExample(labelEmp);
- }
- result+=count;
- }
- if (result > 0) {
- SysLog sysLog = new SysLog();
- sysLog.setLogID(UUID.randomUUID().toString());
- sysLog.setPageName("求职人员信息管理");
- sysLog.setPageUrl("/jobusermgr/jobseeker/delete");
- sysLog.setActionName("删除求职人员");
- sysLog.setUserID(accountService.getLoginUserID());
- sysLog.setLogTime(new Date());
- sysLog.setIPAddress(IpUtils.getIpAddr(request));
- sysLog.setOperationData(delInfo.substring(0, delInfo.length() - 1)); // 注意移除最后一个,
- sysLogMapper.insert(sysLog);
- }
- return result;
- }
- @Override
- public int save(JobUserVo data, String userId) {
- int result = baseInfoSave(data,userId);
- if( result >= 1) {
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- List<String> ids = new ArrayList<>();
- ids.add(data.getJobUserID());
- deleteEducation(ids);
- deleteExperience(ids);
- honorService.deleteByJobUserID(data.getJobUserID());
- data.getJobEducation().stream().forEach(x -> {
- PcEducation education = new PcEducation();
- education.setEducationID(UUID.randomUUID().toString());
- education.setJobuserID(data.getJobUserID());
- education.setCultureRank(Integer.parseInt(x.get("cultureRank") + ""));
- education.setSchoolName(x.get("schoolName").toString());
- try {
- education.setSchoolTime(dateFormat.parse(x.get("schoolTime").toString()));
- education.setOverTime(dateFormat.parse(x.get("overTime").toString()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- education.setMajor(x.get("major").toString());
- education.setCreateTime(new Date());
- education.setCreateUserID(userId);
- pcEducationMapper.insert(education);
- });
- data.getJobExperience().stream().forEach(x -> {
- PcExperience experience = new PcExperience();
- experience.setExperienceID(UUID.randomUUID().toString());
- experience.setJobuserID(data.getJobUserID());
- try {
- experience.setStartTime(dateFormat.parse(x.get("startTime").toString()));
- experience.setEndTime(dateFormat.parse(x.get("endTime").toString()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- experience.setDuties(x.get("duties").toString());
- experience.setWorkAddress(x.get("workAddress").toString());
- experience.setCreateTime(new Date());
- experience.setCreateUserID(userId);
- pcExperienceMapper.insert(experience);
- });
- if (data.getJobHonorList() != null && !data.getJobHonorList().isEmpty()){
- data.getJobHonorList().stream().forEach(honor -> {
- honor.setHonorID(UUID.randomUUID().toString());
- honor.setJobUserID(data.getJobUserID());
- honor.setCreateTime(new Date());
- honor.setCreateUserID(userId);
- honorService.save(honor);
- });
- }
- }
- return result;
- }
- private String ifHadRepeatData(JobUserVo data, boolean isEdit,String curUserID){
- var result = 0;
- PcJobuserExample jobUserExp10 = new PcJobuserExample();
- PcJobuserExample.Criteria criteria = jobUserExp10.or();
- List<PcJobuser> selectByExample = new ArrayList<>();
- // 未填写身份证时不进行查询与判断
- if (!stringUtils.IsNullOrEmpty(data.getIdentityNumber())) {
- criteria.andIdentityNumberEqualTo(data.getIdentityNumber());
- criteria.andNameEqualTo(data.getName());
- criteria.andJobuserIDNotEqualTo(data.getJobUserID());
- selectByExample = pcJobuserMapper.selectByExample(jobUserExp10);
- }
- if(!selectByExample.isEmpty()){
- //系统存在与当前保存求职人员相同的姓名和身份证号码则判断是否前数据是否为惠州市就业驿站人员插入
- var repeatData = selectByExample.stream().findFirst().orElse(null);
- if(repeatData != null){
- PcSiteUserExample siteUserExp = new PcSiteUserExample();
- siteUserExp.or().andUserIDEqualTo(repeatData.getCreateUserID());
- var createSiteUserInfo= pcSiteUserMapper.selectByExample(siteUserExp).stream().findFirst().orElse(null);
- if( createSiteUserInfo!=null){
- PcSiteExample siteExp = new PcSiteExample();
- siteExp.or().andSiteIDEqualTo(createSiteUserInfo.getSiteID());
- var curSiteInfo= pcSiteMapper.selectByExample(siteExp).stream().findFirst().orElse(null);
- if( curSiteInfo != null){
- if(isEdit){
- if( curSiteInfo.getSiteID().equals("66fc1176-b8a1-4b9a-b2fc-9f590ceed342")||curSiteInfo.getSiteID().equals("0c037144-99c6-4e90-bf25-2c9cea8c7b7a")){
- repeatData.setSiteID(data.getSiteID());
- repeatData.setModifyTime(new Date());
- repeatData.setModifyUserID(curUserID);
- pcJobuserMapper.updateByPrimaryKey(repeatData);
- return "-1";
- }else{
- throw new BaseException("1004","该求职人员已被"+curSiteInfo.getSiteName()+",工号"+createSiteUserInfo.getUserNo()+"录入!");
- }
- }
- return "该求职人员已被"+ curSiteInfo.getSiteName()+",工号"+createSiteUserInfo.getUserNo()+"录入!";
- }
- }
- }
- }
- else{
- boolean ifRepeatIdentity = false;
- if (!stringUtils.IsNullOrEmpty(data.getIdentityNumber())){
- PcJobuserExample jobUserExp1 = new PcJobuserExample();
- jobUserExp1.or().andIdentityNumberEqualTo(data.getIdentityNumber()).andJobuserIDNotEqualTo(data.getJobUserID());
- ifRepeatIdentity = pcJobuserMapper.selectByExample(jobUserExp1).size()>0;
- }
- PcJobuserExample jobUserExp2 = new PcJobuserExample();
- jobUserExp2.or().andUserMobileEqualTo(data.getUserMobile()).andJobuserIDNotEqualTo(data.getJobUserID());
- var ifRepeatMobile = pcJobuserMapper.selectByExample(jobUserExp2).size()>0;
- if(!stringUtils.IsNullOrEmpty(data.getSocialSecurityCard())){
- PcJobuserExample jobUserExp3 = new PcJobuserExample();
- jobUserExp3.or().andSocialSecurityCardEqualTo(data.getSocialSecurityCard()).andJobuserIDNotEqualTo(data.getJobUserID());
- var ifRepeatSocialCard = pcJobuserMapper.selectByExample(jobUserExp3).size()>0;
- result += ifRepeatSocialCard ? 4:0;
- }
- result += ifRepeatIdentity? 1:0;
- result += ifRepeatMobile? 2:0;
- }
- if(result > 0 ) {
- var errorMsg = "";
- switch (result){
- case 1:
- errorMsg = "身份证号码重复!";
- break;
- case 2:
- errorMsg = "联系电话已存在!";
- break;
- case 3:
- errorMsg = "身份证号码、联系电话重复!";
- break;
- case 4:
- errorMsg = "社保卡已绑定其他人员!";
- break;
- case 5:
- errorMsg = "身份证号码、社保卡号重复!";
- break;
- case 6:
- errorMsg = "联系电话、社保卡号重复!";
- break;
- case 7:
- errorMsg = "身份证号码、联系电话、社保卡号重复!";
- break;
- }
- if(isEdit) throw new BaseException("1004",errorMsg);
- else return errorMsg;
- }
- return "0";
- }
- @Override
- public int baseInfoSave(JobUserVo data, String userId) {
- int result = 0;
- PcJobuser dbData = pcJobuserMapper.selectByPrimaryKey(data.getJobUserID());
- var resultNum = Integer.valueOf(ifHadRepeatData(data,true,userId));
- if( resultNum > 0 ) {
- throw new BaseException("1004","该求职人员已被录入!");
- }
- // JobUserServiceVo jobUserServiceVo = new JobUserServiceVo();
- // jobUserServiceVo.setJobUserID(data.getJobUserID());
- // jobUserServiceVo.setServiceTime(new Date());
- // jobUserServiceVo.setServiceUserID(userId);
- if (dbData == null) {
- //这里已直接将求职人员转至当前驿站下
- if(resultNum.equals(-1)){
- result = 1;
- }
- else {
- dbData = new PcJobuser();
- dbData.setJobuserID(data.getJobUserID());
- dbData.setSiteID(data.getSiteID());
- dbData.setIdentityNumber(data.getIdentityNumber());
- dbData.setName(data.getName());
- dbData.setPyName(data.getPyName());
- dbData.setEngName(data.getEngName());
- dbData.setJobStatusID(data.getJobStatusID());
- dbData.setSex(data.getSex());
- dbData.setNation(data.getNation());
- dbData.setPoliticsStatusID(data.getPoliticsStatusID());
- dbData.setBirthplace(data.getBirthPlace());
- dbData.setBirthDay(data.getBirthDay());
- dbData.setFamilyNatureID(data.getFamilyNatureID());
- dbData.setFamilyAddress(data.getFamilyAddress());
- dbData.setCultureRank(data.getCultureRank());
- dbData.setHealthID(data.getHealthID());
- dbData.setHeight(data.getHeight());
- dbData.setBloodTypeID(data.getBloodTypeID());
- dbData.setVision(data.getVision());
- dbData.setWeight(data.getWeight());
- dbData.setMaritalStatusID(data.getMaritalStatusID());
- dbData.setProvinceCode(data.getProvinceCode());
- dbData.setRegionCode(data.getRegionCode());
- dbData.setStreetCode(data.getStreetCode());
- dbData.setUserName(data.getUserName());
- dbData.setUserMobile(data.getUserMobile());
- dbData.setAddress(data.getAddress());
- dbData.setPostalCode(data.getPostalCode());
- dbData.setEmail(data.getEmail());
- dbData.setHobby(data.getHobby());
- dbData.setKeyPersonTypeID(data.getKeyPersonTypeID());
- dbData.setPersonalSkills(data.getPersonalSkills());
- dbData.setOpenId(data.getOpenId());
- dbData.setIsAppInsert(data.getIsAppInsert()==null?0:1);
- dbData.setSocialSecurityCard(data.getSocialSecurityCard());
- dbData.setFinishSchool(data.getFinishSchool());
- dbData.setFinishDate(data.getFinishDate());
- dbData.setProfession(data.getProfession());
- dbData.setIsFullTime(data.getIsFullTime());
- dbData.setOccupationalCategory(data.getOccupationalCategory());
- dbData.setOccupationalLevel(data.getOccupationalLevel());
- dbData.setNativePlace(data.getNativePlace());
- dbData.setLongitude(data.getLongitude());
- dbData.setLatitude(data.getLatitude());
- dbData.setEducationalSystem(data.getEducationalSystem());
- dbData.setDifficultSituationID(data.getDifficultSituationID());
- dbData.setOrdinaryPersonTypeID(data.getOrdinaryPersonTypeID());
- dbData.setEsHouseholdRegistration(data.getEsHouseholdRegistration());
- dbData.setCreateTime(new Date());
- dbData.setCreateUserID(userId);
- result = pcJobuserMapper.insert(dbData);
- }
- // jobUserServiceVo.setServiceContent("登记求职者个人求职信息");
- }
- else {
- dbData.setJobuserID(data.getJobUserID());
- dbData.setSiteID(data.getSiteID());
- dbData.setIdentityNumber(data.getIdentityNumber());
- dbData.setName(data.getName());
- dbData.setPyName(data.getPyName());
- dbData.setEngName(data.getEngName());
- dbData.setSex(data.getSex());
- dbData.setJobStatusID(data.getJobStatusID());
- dbData.setNation(data.getNation());
- dbData.setPoliticsStatusID(data.getPoliticsStatusID());
- dbData.setBirthplace(data.getBirthPlace());
- dbData.setBirthDay(data.getBirthDay());
- dbData.setFamilyNatureID(data.getFamilyNatureID());
- dbData.setFamilyAddress(data.getFamilyAddress());
- dbData.setCultureRank(data.getCultureRank());
- dbData.setHealthID(data.getHealthID());
- dbData.setHeight(data.getHeight());
- dbData.setBloodTypeID(data.getBloodTypeID());
- dbData.setVision(data.getVision());
- dbData.setWeight(data.getWeight());
- dbData.setMaritalStatusID(data.getMaritalStatusID());
- dbData.setProvinceCode(data.getProvinceCode());
- dbData.setRegionCode(data.getRegionCode());
- dbData.setStreetCode(data.getStreetCode());
- dbData.setUserName(data.getUserName());
- dbData.setUserMobile(data.getUserMobile());
- dbData.setAddress(data.getAddress());
- dbData.setPostalCode(data.getPostalCode());
- dbData.setEmail(data.getEmail());
- dbData.setHobby(data.getHobby());
- dbData.setKeyPersonTypeID(data.getKeyPersonTypeID());
- dbData.setPersonalSkills(data.getPersonalSkills());
- dbData.setOpenId(data.getOpenId());
- dbData.setIsAppInsert(data.getIsAppInsert()==null?0:1);
- dbData.setSocialSecurityCard(data.getSocialSecurityCard());
- dbData.setFinishSchool(data.getFinishSchool());
- dbData.setFinishDate(data.getFinishDate());
- dbData.setProfession(data.getProfession());
- dbData.setIsFullTime(data.getIsFullTime());
- dbData.setOccupationalCategory(data.getOccupationalCategory());
- dbData.setOccupationalLevel(data.getOccupationalLevel());
- dbData.setNativePlace(data.getNativePlace());
- dbData.setLongitude(data.getLongitude());
- dbData.setLatitude(data.getLatitude());
- dbData.setEducationalSystem(data.getEducationalSystem());
- dbData.setDifficultSituationID(data.getDifficultSituationID());
- dbData.setOrdinaryPersonTypeID(data.getOrdinaryPersonTypeID());
- dbData.setEsHouseholdRegistration(data.getEsHouseholdRegistration());
- dbData.setModifyTime(new Date());
- dbData.setModifyUserID(userId);
- result = pcJobuserMapper.updateByPrimaryKey(dbData);
- // jobUserServiceVo.setServiceContent("更新求职者个人求职信息");
- }
- PcLabelJobuserExample labelEmp = new PcLabelJobuserExample();
- labelEmp.or().andJobuserIDEqualTo(data.getJobUserID());
- pcLabelJobuserMapper.deleteByExample(labelEmp);
- if(data.listLabel!=null && data.listLabel.size()>0){
- data.listLabel.forEach(x->{
- PcLabelJobuser labelModel = new PcLabelJobuser();
- labelModel.setJobuserID(data.getJobUserID());
- labelModel.setLabelID(x.getLabelID());
- pcLabelJobuserMapper.insert(labelModel);
- });
- }
- // 保存服务记录
- // if (result > 0){
- // jobUserServiceService.save(jobUserServiceVo, userId);
- // }
- return result;
- }
- @Override
- public List<JobUserVo> importJobUser(List<JobUserVo> dataList, String userID) {
- if (dataList.size() <= 0)
- throw new BaseException("", "请添加导入数据!");
- //性别
- List<SysDictionaryItem> dicJobUserGenderList = dictionaryService.getDictionaryItemList("Gender");
- //重点人员类别
- List<SysDictionaryItem> dicKeyPersonTypeList = dictionaryService.getDictionaryItemList("KeyPersonType");
- // 普通人员类别
- List<SysDictionaryItem> ordinaryPersonTypeList = dictionaryService.getDictionaryItemList("OrdinaryPersonType");
- //就业状态
- List<SysDictionaryItem> dicJobStatusList = dictionaryService.getDictionaryItemList("JobStatus");
- // 困难状况
- List<SysDictionaryItem> difficultSituationList = dictionaryService.getDictionaryItemList("DifficultSituation");
- //所属驿站
- PcSite curLoginUserSiteInfo = null;
- PcSiteUserExample siteUserExp = new PcSiteUserExample();
- siteUserExp.or().andUserIDEqualTo(userID);
- PcSiteUser curLoginSiteUser = pcSiteUserMapper.selectByExample(siteUserExp).stream().findFirst().orElse(null);
- if(curLoginSiteUser==null){
- throw new BaseException("", "未能查询到当前登录人的驿站人员信息!");
- }
- else{
- PcSiteExample siteExp = new PcSiteExample();
- siteExp.or().andSiteIDEqualTo(curLoginSiteUser.getSiteID());
- curLoginUserSiteInfo = pcSiteMapper.selectByExample(siteExp).stream().findFirst().orElse(null);
- }
- //是否全日制
- List<SysDictionaryItem> dicIsFullTimeList = dictionaryService.getDictionaryItemList("IsFullTime");
- //职业资格类别
- List<SysDictionaryItem> secondLevelOcCategoryList = new ArrayList<>();
- PcOccupationalExample occupationalExp = new PcOccupationalExample();
- occupationalExp.or().andParentOccupationalIDEqualTo("0").andStatusEqualTo(1);
- var firstLevelData = pcOccupationalMapper.selectByExample(occupationalExp);
- for (PcOccupational curOccupational : firstLevelData) {
- occupationalExp = new PcOccupationalExample();
- occupationalExp.or().andParentOccupationalIDEqualTo(curOccupational.getOccupationalID()).andStatusEqualTo(1);
- var secondLevelData = pcOccupationalMapper.selectByExample(occupationalExp);
- for (PcOccupational curChildOccupational : secondLevelData) {
- SysDictionaryItem item = new SysDictionaryItem();
- item.setCode(curChildOccupational.getOccupationalID());
- item.setName(curChildOccupational.getOccupationalName());
- secondLevelOcCategoryList.add(item);
- }
- }
- //职业资格等级
- List<SysDictionaryItem> dicOcclLevelList = dictionaryService.getDictionaryItemList("OccupationalLevel");
- //民族
- List<SysDictionaryItem> dicNationTypeList = dictionaryService.getDictionaryItemList("NationType");
- //政治面貌
- List<SysDictionaryItem> dicPoliticsTypeList = dictionaryService.getDictionaryItemList("PoliticsStatus");
- //户口性质
- List<SysDictionaryItem> dicFamilyNatureList = dictionaryService.getDictionaryItemList("FamilyNature");
- //最高学历
- List<SysDictionaryItem> dicHighestDegreeList = dictionaryService.getDictionaryItemList("HighestDegree");
- //健康状况
- List<SysDictionaryItem> dicHealthTypeList = dictionaryService.getDictionaryItemList("Health");
- //婚姻状况
- List<SysDictionaryItem> dicMaritalStatusList = dictionaryService.getDictionaryItemList("MaritalStatus");
- //市/县
- List<SysDictionaryItem> regionDataList = new ArrayList<>();
- AreaCodeExample regionExp= new AreaCodeExample();
- regionExp.or().andFidEqualTo("441300000000000").andLvEqualTo("3");
- var thirdLevelRegionList = areaCodeMapper.selectByExample(regionExp);
- for (AreaCode curRegionData : thirdLevelRegionList) {
- SysDictionaryItem item = new SysDictionaryItem();
- item.setCode(curRegionData.getCode());
- item.setName(curRegionData.getName());
- regionDataList.add(item);
- }
- //镇街
- List<SysDictionaryItem> streetDataList = new ArrayList<>();
- AreaCodeExample streetExp= new AreaCodeExample();
- streetExp.or().andLvEqualTo("4");
- var forthLevelStreetList = areaCodeMapper.selectByExample(streetExp);
- for (AreaCode curStreetData : forthLevelStreetList) {
- SysDictionaryItem item = new SysDictionaryItem();
- item.setCode(curStreetData.getCode());
- item.setName(curStreetData.getName());
- streetDataList.add(item);
- }
- List<JobUserVo> resultList = new ArrayList<>();
- PcSite finalCurLoginUserSiteInfo = curLoginUserSiteInfo;
- HashMap<String,String> idPhoneList = new HashMap<>();
- dataList.forEach(item->{
- if(!idPhoneList.containsValue(item.getIdentityNumber())){
- idPhoneList.put("IdentityNumber",item.getIdentityNumber());
- }else{
- throw new BaseException("","求职人员导入数据存在相同的身份证号码!");
- }
- if(!idPhoneList.containsValue(item.getUserMobile())){
- idPhoneList.put("UserMobile",item.getUserMobile());
- }else{
- throw new BaseException("","求职人员导入数据存在相同的联系电话!");
- }
- });
- dataList.forEach(item -> {
- String errorInfo = "";
- item.setJobUserID(UUID.randomUUID().toString());
- if (stringUtils.IsNullOrEmpty(item.getName())){
- errorInfo += "请填写姓名!";
- }
- if (stringUtils.IsNullOrEmpty(item.getBirthDayStr())){
- errorInfo += "请填写出生日期!";
- } else {
- item.setBirthDay(dateUtils.StrToDate(item.getBirthDayStr(), "yyyy-MM-dd"));
- }
- if (!stringUtils.IsNullOrEmpty(item.getIdentityNumber())){
- if(regexUtils.theIdCardIsValid(item.getIdentityNumber())) {
- var birthDay = dateUtils.StrToDate((item.getIdentityNumber().substring(6,10)+"-"+item.getIdentityNumber().substring(10,12)+"-"+item.getIdentityNumber().substring(12,14)),"yyyy-MM-dd");
- var sexStr = Integer.parseInt(item.getIdentityNumber().substring(16,17));
- if(!stringUtils.IsNullOrEmpty(item.getBirthDayStr())){
- if(!birthDay.equals(dateUtils.StrToDate(item.getBirthDayStr(),"yyyy-MM-dd"))){
- errorInfo += "出生日期与身份证号不匹配!";
- }
- }else{
- item.setBirthDay(birthDay);
- }
- if(!stringUtils.IsNullOrEmpty(item.getSexName())){
- if((sexStr%2==0&&item.getSexName().equals("男"))||(sexStr%2!=0&&item.getSexName().equals("女"))){
- errorInfo += "性别与身份证号不匹配!";
- }
- }
- item.setIdentityNumber(desUtils.encoderText(item.getIdentityNumber()));
- }else{
- errorInfo += "身份证号码不合法!";
- }
- }
- if (stringUtils.IsNullOrEmpty(item.getUserMobile()))
- errorInfo += "请填写联系电话!";
- else{
- if(!regexUtils.theMobileIsValid(item.getUserMobile(),false)){
- errorInfo += "联系电话不合法!";
- }else{
- item.setUserMobile(desUtils.encoderText(item.getUserMobile()));
- var repeatResult = ifHadRepeatData(item,false,userID);
- errorInfo += !repeatResult.equals("0")? repeatResult:"";
- }
- }
- if (stringUtils.IsNullOrEmpty(item.getSexName()))
- errorInfo += "请选择性别!";
- else {
- item.setSex(dicJobUserGenderList.stream().filter(it -> it.getName().equals(item.getSexName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getSex() == null || item.getSex() == 0)
- errorInfo += "性别不存在!";
- }
- if (stringUtils.IsNullOrEmpty(item.getKeyPersonTypeName()))
- errorInfo += "请选择重点人员类别!";
- else {
- item.setKeyPersonTypeID(dicKeyPersonTypeList.stream().filter(it -> it.getName().equals(item.getKeyPersonTypeName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getKeyPersonTypeID() == null){
- errorInfo += "重点人员类别不存在!";
- }
- }
- if (stringUtils.IsNullOrEmpty(item.getOrdinaryPersonTypeName()))
- errorInfo += "请选择人员类别!";
- else {
- item.setOrdinaryPersonTypeID(ordinaryPersonTypeList.stream().filter(it -> it.getName().equals(item.getOrdinaryPersonTypeName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getOrdinaryPersonTypeID() == null)
- errorInfo += "人员类别不存在!";
- else {
- if(item.getOrdinaryPersonTypeID().equals(2) && stringUtils.IsNullOrEmpty(item.getFinishDate())){
- errorInfo += "应届高校毕业生必须填写毕业日期!";
- }
- if(item.getOrdinaryPersonTypeID().equals(2) && item.getEducationalSystem() == null){
- errorInfo += "应届高校毕业生必须填写学制!";
- }
- if(item.getOrdinaryPersonTypeID().equals(2) && stringUtils.IsNullOrEmpty(item.getFinishSchool())){
- errorInfo += "应届高校毕业生必须填写毕业院校!";
- }
- }
- }
- if(!stringUtils.IsNullOrEmpty(item.getFinishDate()))
- item.setFinishDate(item.getFinishDate().substring(0,7));
- if (stringUtils.IsNullOrEmpty(item.getJobStatusName()))
- errorInfo += "请选择就业状态!";
- else {
- item.setJobStatusID(dicJobStatusList.stream().filter(it -> it.getName().equals(item.getJobStatusName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getJobStatusID() == null || item.getJobStatusID() == 0)
- errorInfo += "就业状态不存在!";
- }
- if (stringUtils.IsNullOrEmpty(item.getSiteName()))
- errorInfo += "请填写所属驿站!";
- else {
- if (finalCurLoginUserSiteInfo!=null){
- if(!item.getSiteName().trim().equals(finalCurLoginUserSiteInfo.getSiteName().trim())){
- errorInfo += "请填写您所在的驿站名称!";
- }else{
- item.setSiteID(finalCurLoginUserSiteInfo.getSiteID());
- }
- }
- }
- if (stringUtils.IsNullOrEmpty(item.getAddress()))
- errorInfo += "请填写地址!";
- if (!stringUtils.IsNullOrEmpty(item.getIsFullTimeName())){
- item.setIsFullTime(dicIsFullTimeList.stream().filter(it -> it.getName().equals(item.getIsFullTimeName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getIsFullTime() == null || item.getIsFullTime() == 0)
- errorInfo += "是否全日制不存在!";
- }
- if (!stringUtils.IsNullOrEmpty(item.getDifficultSituationName())){
- item.setDifficultSituationID(difficultSituationList.stream().filter(it -> it.getName().equals(item.getDifficultSituationName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getDifficultSituationID() == null){
- errorInfo += "困难状况不存在!";
- }
- }
- if (!stringUtils.IsNullOrEmpty(item.getOccupationalCategoryName())){
- item.setOccupationalCategory(secondLevelOcCategoryList.stream().filter(it -> it.getName().equals(item.getOccupationalCategoryName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getCode());
- if (item.getOccupationalCategory() == null)
- errorInfo += "职业资格类别不存在!";
- }
- if (!stringUtils.IsNullOrEmpty(item.getOccupationalLevelName())) {
- item.setOccupationalLevel(dicOcclLevelList.stream().filter(it -> it.getName().equals(item.getOccupationalLevelName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getOccupationalLevel() == null || item.getOccupationalLevel() == 0)
- errorInfo += "职业资格等级不存在!";
- }
- if (!stringUtils.IsNullOrEmpty(item.getNationName())) {
- item.setNation(dicNationTypeList.stream().filter(it -> it.getName().equals(item.getNationName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getNation() == null || item.getNation() == 0)
- errorInfo += "民族不存在!";
- }
- if (!stringUtils.IsNullOrEmpty(item.getPoliticsStatusName())) {
- item.setPoliticsStatusID(dicPoliticsTypeList.stream().filter(it -> it.getName().equals(item.getPoliticsStatusName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getPoliticsStatusID() == null || item.getPoliticsStatusID() == 0)
- errorInfo += "政治面貌不存在!";
- }
- if (!stringUtils.IsNullOrEmpty(item.getFamilyNatureName())) {
- item.setFamilyNatureID(dicFamilyNatureList.stream().filter(it -> it.getName().equals(item.getFamilyNatureName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getFamilyNatureID() == null || item.getFamilyNatureID() == 0)
- errorInfo += "户口性质不存在!";
- }
- if (!stringUtils.IsNullOrEmpty(item.getCultureRankName())) {
- item.setCultureRank(dicHighestDegreeList.stream().filter(it -> it.getName().equals(item.getCultureRankName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getCultureRank() == null || item.getCultureRank() == 0)
- errorInfo += "最高学历不存在!";
- }
- if (!stringUtils.IsNullOrEmpty(item.getHealthName())) {
- item.setHealthID(dicHealthTypeList.stream().filter(it -> it.getName().equals(item.getHealthName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getHealthID() == null || item.getHealthID() == 0)
- errorInfo += "健康状况不存在!";
- }
- if (!stringUtils.IsNullOrEmpty(item.getMaritalStatusName())) {
- item.setMaritalStatusID(dicMaritalStatusList.stream().filter(it -> it.getName().equals(item.getMaritalStatusName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getValue());
- if (item.getMaritalStatusID() == null || item.getMaritalStatusID() == 0)
- errorInfo += "婚姻状况不存在!";
- }
- if (!stringUtils.IsNullOrEmpty(item.getEmail())) {
- if (!regexUtils.theEmailIsValid(item.getEmail()))
- errorInfo += "电子邮箱不合法!";
- }
- if (!stringUtils.IsNullOrEmpty(item.getProvinceName())) {
- if((item.getProvinceName().trim()).equals("广东省")){
- item.setProvinceCode("440000000000000");
- }else{
- errorInfo += "省份不存在!";
- }
- }
- if (stringUtils.IsNullOrEmpty(item.getUserMobile()))
- errorInfo += "请选择市/县!";
- else{
- item.setRegionCode(regionDataList.stream().filter(it -> it.getName().equals(item.getRegionName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getCode());
- if (item.getRegionCode() == null)
- errorInfo += "市/县不存在!";
- else{
- if(!item.getRegionCode().equals(finalCurLoginUserSiteInfo.getRegionCode())){
- errorInfo += "请选择您所在驿站的市/县!";
- }
- }
- }
- if (!stringUtils.IsNullOrEmpty(item.getStreetName())) {
- item.setStreetCode(streetDataList.stream().filter(it -> it.getName().equals(item.getStreetName().trim()))
- .findFirst().orElse(new SysDictionaryItem()).getCode());
- if (item.getStreetCode() == null)
- errorInfo += "镇街不存在!";
- else{
- if (stringUtils.IsNullOrEmpty(item.getRegionName())){
- errorInfo += "请选择相关市/县!";
- }else{
- AreaCodeExample curStreetExp = new AreaCodeExample();
- curStreetExp.or().andCodeEqualTo(item.getStreetCode());
- var curStreetReginCode = areaCodeMapper.selectByExample(curStreetExp).get(0).getFid();
- if(item.getRegionCode()!= null&&!curStreetReginCode.equals(item.getRegionCode())){
- errorInfo += "镇街不属于当前市/县!";
- }
- }
- }
- }
- item.setJobEducation(new ArrayList<>());
- item.setJobExperience(new ArrayList<>());
- if (stringUtils.IsNullOrEmpty(errorInfo)) {
- resultList.add(item);
- } else {
- item.setErrorMessage(errorInfo);
- }
- });
- if (dataList.stream().filter(it -> !stringUtils.IsNullOrEmpty(it.errorMessage)).collect(Collectors.toList()).size() > 0)
- return dataList;
- resultList.forEach(item -> {
- save(item, userID);
- });
- return null;
- }
- @Override
- public PageInfo<JobUserMapVo> getDataMapList(int pageIndex, int pageSize, Integer keyTypeValue,
- String regionCode, String labelID, Integer minAge,
- Integer maxAge, String jobUserName) {
- PageHelper.startPage(pageIndex, pageSize);
- List<JobUserMapVo> dataMapList = jobUserCQuery.getDataMapList(keyTypeValue, regionCode, labelID, minAge, maxAge, jobUserName);
- PageInfo<JobUserMapVo> result = new PageInfo<>(dataMapList);
- // 获取所有的求职人员ID
- List<String> jobUserIDs = result.getList().stream()
- .filter(Objects::nonNull)
- .map(JobUserMapVo::getJobUserID)
- .filter(Objects::nonNull)
- .collect(Collectors.toList());
- if (!jobUserIDs.isEmpty()) {
- // 查询求职意向并映射到求职人员
- List<JobHuntVo> jobHuntList = jobHuntCQuery.selectJobHuntInCompanyIDs(stringUtils.ListToInSql(jobUserIDs));
- Map<String, List<JobHuntVo>> jobHuntMap = (jobHuntList != null) ?
- jobHuntList.stream()
- .filter(Objects::nonNull)
- .collect(Collectors.groupingBy(JobHuntVo::getJobUserID))
- : new HashMap<>();
- // 查询服务记录
- List<JobUserServiceVo> jobUserServiceVos = jobUserServiceCQuery.jobUserMapGetService(stringUtils.ListToInSql(jobUserIDs), null);
- result.getList().forEach(jobUser -> {
- if (jobUser != null && jobUser.getJobUserID() != null) {
- // 填充服务时间
- jobUser.setServiceTime(jobUserServiceVos
- .stream()
- .filter(service -> service.getJobUserID().equals(jobUser.getJobUserID()))
- .findFirst()
- .orElse(new JobUserServiceVo())
- .getServiceTime());
- // 填充求职意向数据
- jobUser.setJobHuntList(jobHuntMap.getOrDefault(jobUser.getJobUserID(), new ArrayList<>()));
- }
- });
- }
- return result;
- }
- @Override
- public int editOpenID(JobUserVo data) {
- PcJobuserExample example = new PcJobuserExample();
- example.or().andIdentityNumberEqualTo(desUtils.encoderText(data.getIdentityNumber()));
- List<PcJobuser> pcJobusers = pcJobuserMapper.selectByExample(example);
- if (pcJobusers.isEmpty()){
- throw new BaseException("1005", "该身份证在系统中未录入,请联系工作人员补录后重试");
- }
- PcJobuser pcJobuser = pcJobusers.get(0);
- // 已经OpenID则不修改
- if (!stringUtils.IsNullOrEmpty(pcJobuser.getOpenId())){
- return 1;
- }
- pcJobuser.setOpenId(data.openId);
- return pcJobuserMapper.updateByPrimaryKey(pcJobuser);
- }
- @Override
- public PageInfo<ClaimJobUserVo> selectClaimJobUserList(Integer pageIndex, Integer pageSize, String name, String address, Integer KeyPersonTypeID) {
- PageHelper.startPage(pageIndex, pageSize);
- List<ClaimJobUserVo> list = jobUserCQuery.selectClaimJobUserList(name, address, KeyPersonTypeID, "66fc1176-b8a1-4b9a-b2fc-9f590ceed342");
- // 信息脱敏
- list.forEach(item -> {
- item.setUserMobile(calculateUtils.maskMobile(desUtils.decoderText(item.getUserMobile())));
- String idNumber = desUtils.decoderText(item.getIdentityNumber());
- item.setAge(calculateUtils.calculateAge(idNumber));
- });
- PageInfo<ClaimJobUserVo> result = new PageInfo(list);
- return result;
- }
- @Override
- public int claimJobUser(List<String> ids, String siteID) {
- PcSite site = pcSiteMapper.selectByPrimaryKey(siteID);
- return jobUserCQuery.ClaimJobUserList(stringUtils.ListToInSql(ids), siteID, site.getRegionCode(), site.getStreetCode());
- }
- }
|