@ -3,10 +3,17 @@ package com.weaver.sxjg.esb;
import cn.hutool.core.collection.CollectionUtil ;
import cn.hutool.core.collection.CollectionUtil ;
import com.alibaba.fastjson.JSONArray ;
import com.alibaba.fastjson.JSONArray ;
import com.alibaba.fastjson.JSONObject ;
import com.alibaba.fastjson.JSONObject ;
import com.fasterxml.jackson.databind.ObjectMapper ;
import com.weaver.common.base.entity.result.WeaResult ;
import com.weaver.ebuilder.common.exception.BusinessException ;
import com.weaver.ebuilder.common.exception.BusinessException ;
import com.weaver.esb.api.rpc.EsbRpcRemoteInterface ;
import com.weaver.esb.api.rpc.EsbRpcRemoteInterface ;
import com.weaver.framework.rpc.annotation.RpcReference ;
import com.weaver.recruit.entity.* ;
import com.weaver.recruit.enums.* ;
import com.weaver.recruit.rest.RecruitCandidateRemoteService ;
import com.weaver.sxjg.config.EbDbDataSourceConfig ;
import com.weaver.sxjg.config.EbDbDataSourceConfig ;
import com.weaver.sxjg.util.SxjgUtil ;
import com.weaver.sxjg.util.SxjgUtil ;
import org.apache.commons.collections.list.AbstractLinkedList ;
import org.apache.commons.configuration.ConfigurationException ;
import org.apache.commons.configuration.ConfigurationException ;
import org.apache.commons.configuration.PropertiesConfiguration ;
import org.apache.commons.configuration.PropertiesConfiguration ;
import org.apache.commons.httpclient.NameValuePair ;
import org.apache.commons.httpclient.NameValuePair ;
@ -15,20 +22,21 @@ import org.junit.Test;
import org.slf4j.Logger ;
import org.slf4j.Logger ;
import org.slf4j.LoggerFactory ;
import org.slf4j.LoggerFactory ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.boot.jdbc.DataSourceBuilder ;
import org.springframework.jdbc.core.JdbcTemplate ;
import org.springframework.jdbc.core.JdbcTemplate ;
import org.springframework.stereotype.Service ;
import org.springframework.stereotype.Service ;
import javax.sql.DataSource ;
import java.io.IOException ;
import java.io.InputStream ;
import java.math.BigDecimal ;
import java.math.BigDecimal ;
import java.util.Date ;
import java.net.URL ;
import java.util.HashMap ;
import java.net.URLConnection ;
import java.util.List ;
import java.text.ParseException ;
import java.util.Map ;
import java.text.SimpleDateFormat ;
import java.util.* ;
/ * *
/ * *
* @author liuhao
* @author liuhao
* @use : 职 位 - 新 增 , 修 改 , 发 布 , 下 线 接 口 对 接 智 联 招 聘
* @use : 职 位 - 新 增 , 修 改 , 发 布 , 下 线 接 口 对 接 智 联 招 聘 ( 校 招 )
* @date
* @date
* /
* /
@Service ( "esbRpcPositionZhilian_sj" )
@Service ( "esbRpcPositionZhilian_sj" )
@ -45,9 +53,17 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
private String joboffline ;
private String joboffline ;
private String wslburl ;
private String wslburl ;
private String wslbxqurl ;
private String wslbxqurl ;
private String annex ;
private String secretKey ;
private String tenantKey ;
private String managerId ;
@Autowired
@Autowired
public EbDbDataSourceConfig ebDbDataSourceConfig ;
public EbDbDataSourceConfig ebDbDataSourceConfig ;
@RpcReference
RecruitCandidateRemoteService recruitCandidateRemoteService ;
public EsbRpcPositionZhilian ( ) {
public EsbRpcPositionZhilian ( ) {
PropertiesConfiguration p = null ;
PropertiesConfiguration p = null ;
try {
try {
@ -65,6 +81,10 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
this . setJoboffline ( p . getString ( "sxjg.joboffline" ) ) ;
this . setJoboffline ( p . getString ( "sxjg.joboffline" ) ) ;
this . setWslburl ( p . getString ( "sxjg.wslburl" ) ) ;
this . setWslburl ( p . getString ( "sxjg.wslburl" ) ) ;
this . setWslbxqurl ( p . getString ( "sxjg.wslbxqurl" ) ) ;
this . setWslbxqurl ( p . getString ( "sxjg.wslbxqurl" ) ) ;
this . setSecretKey ( p . getString ( "sxjg.secretkey" ) ) ;
this . setTenantKey ( p . getString ( "tenantKey" ) ) ;
this . setManagerId ( p . getString ( "managerid" ) ) ;
this . setAnnex ( "sxjg.annexurl" ) ;
} catch ( ConfigurationException e ) {
} catch ( ConfigurationException e ) {
throw new BusinessException ( "获取sxjg.properties配置文件失败, " , e ) ;
throw new BusinessException ( "获取sxjg.properties配置文件失败, " , e ) ;
}
}
@ -141,7 +161,9 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
String jobsyctime = ( String ) m . get ( "jobsyctime" ) ; //上一次更新时间
String jobsyctime = ( String ) m . get ( "jobsyctime" ) ; //上一次更新时间
Date preTimesql = SxjgUtil . getDateByTimestr ( jobsyctime , "yyyy-MM-dd HH:mm:ss" ) ;
Date preTimesql = SxjgUtil . getDateByTimestr ( jobsyctime , "yyyy-MM-dd HH:mm:ss" ) ;
String preTimejk = SxjgUtil . getTimeStrByDate ( preTimesql , "yyyy/MM/dd HH:mm" ) ;
String preTimejk = SxjgUtil . getTimeStrByDate ( preTimesql , "yyyy/MM/dd HH:mm" ) ;
Date now = new Date ( ) ;
//判断如果大于6天 则当前时间取6天后
Date now1 = new Date ( ) ;
Date now = SxjgUtil . sixDaylater ( preTimesql , now1 ) ; //判断 大于6天取6天后
String nowTimejk = SxjgUtil . getTimeStrByDate ( now , "yyyy/MM/dd HH:mm" ) ;
String nowTimejk = SxjgUtil . getTimeStrByDate ( now , "yyyy/MM/dd HH:mm" ) ;
String nowTimeSql = SxjgUtil . getTimeStrByDate ( now , "yyyy-MM-dd HH:mm:ss" ) ;
String nowTimeSql = SxjgUtil . getTimeStrByDate ( now , "yyyy-MM-dd HH:mm:ss" ) ;
try {
try {
@ -163,6 +185,10 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
log . error ( "当前职位id: " + id + " 并未找到jobNumber, 请先新增职位! " ) ;
log . error ( "当前职位id: " + id + " 并未找到jobNumber, 请先新增职位! " ) ;
throw new Exception ( "当前职位并未找到jobNumber! " ) ;
throw new Exception ( "当前职位并未找到jobNumber! " ) ;
}
}
String qudao = ( String ) params . get ( "qudao" ) ;
if ( ! qudao . contains ( "智联招聘" ) ) {
throw new Exception ( "没有勾选智联招聘,当前数据不走下线接口" ) ;
}
String orgCode = ( String ) params . get ( "orgcode" ) ;
String orgCode = ( String ) params . get ( "orgcode" ) ;
String companyId = SxjgUtil . getZlbh ( orgCode , jdbcTemplate ) ;
String companyId = SxjgUtil . getZlbh ( orgCode , jdbcTemplate ) ;
long companyId1 = Long . parseLong ( companyId ) ;
long companyId1 = Long . parseLong ( companyId ) ;
@ -197,6 +223,12 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
}
}
String qudao = ( String ) params . get ( "qudao" ) ;
String qudao = ( String ) params . get ( "qudao" ) ;
if ( ! qudao . contains ( "智联招聘" ) ) {
if ( ! qudao . contains ( "智联招聘" ) ) {
log . error ( "发布职位,智联:并未勾选智联招聘" ) ;
return ;
}
String zpfs = ( String ) params . get ( "typezhaopin" ) ;
if ( ! zpfs . contains ( "校园" ) ) {
log . error ( "发布职位,智联:并未勾选校园招聘" ) ;
return ;
return ;
}
}
JSONObject jsonObject = new JSONObject ( ) ;
JSONObject jsonObject = new JSONObject ( ) ;
@ -222,6 +254,10 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
if ( ! qudao . contains ( "智联招聘" ) ) {
if ( ! qudao . contains ( "智联招聘" ) ) {
throw new Exception ( "没有勾选智联招聘,当前数据不走同步接口" ) ;
throw new Exception ( "没有勾选智联招聘,当前数据不走同步接口" ) ;
}
}
String jhzpfs = ( String ) params . get ( "typezhaopin" ) ;
if ( ! jhzpfs . contains ( "校园" ) ) {
throw new Exception ( "不是校园招聘,当前数据不走同步接口" ) ;
}
String orgCode = ( String ) params . get ( "orgcode" ) ;
String orgCode = ( String ) params . get ( "orgcode" ) ;
log . error ( "职位id: " + id ) ;
log . error ( "职位id: " + id ) ;
log . error ( "职位所属公司code: " + orgCode ) ;
log . error ( "职位所属公司code: " + orgCode ) ;
@ -377,11 +413,13 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
}
}
//进入分页
//进入分页
for ( int j = 1 ; j < = yeshu ; j + + ) {
for ( int j = 1 ; j < = yeshu ; j + + ) {
if ( yeshu = = 1 ) {
if ( j = = 1 ) {
jsonArray = data . getJSONArray ( "dataList" ) ;
jsonArray = data . getJSONArray ( "dataList" ) ;
if ( jsonArray ! = null & & jsonArray . size ( ) > 0 ) {
dealJsonArrayGetDetail ( jsonArray , companyId , jobNumber , jdbcTemplate ) ;
dealJsonArrayGetDetail ( jsonArray , companyId , jobNumber , jdbcTemplate ) ;
continue ;
continue ;
}
}
}
json1 = new JSONObject ( ) ;
json1 = new JSONObject ( ) ;
json1 . put ( "page" , j ) ;
json1 . put ( "page" , j ) ;
json1 . put ( "pageSize" , 100 ) ;
json1 . put ( "pageSize" , 100 ) ;
@ -393,9 +431,11 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
if ( SxjgUtil . isSuccess ( s1 ) ) {
if ( SxjgUtil . isSuccess ( s1 ) ) {
data = SxjgUtil . getInterfaceData ( s1 ) ;
data = SxjgUtil . getInterfaceData ( s1 ) ;
jsonArray = data . getJSONArray ( "dataList" ) ;
jsonArray = data . getJSONArray ( "dataList" ) ;
if ( jsonArray ! = null & & jsonArray . size ( ) > 0 ) {
dealJsonArrayGetDetail ( jsonArray , companyId , jobNumber , jdbcTemplate ) ;
dealJsonArrayGetDetail ( jsonArray , companyId , jobNumber , jdbcTemplate ) ;
}
}
}
}
}
} else {
} else {
throw new Exception ( "获取网申列表详情失败,失败原因看日志!" ) ;
throw new Exception ( "获取网申列表详情失败,失败原因看日志!" ) ;
}
}
@ -412,14 +452,121 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
json1 . put ( "jobResumeId" , jobResumeId ) ;
json1 . put ( "jobResumeId" , jobResumeId ) ;
json1 . put ( "companyId" , companyid ) ;
json1 . put ( "companyId" , companyid ) ;
String s1 = SxjgUtil . doJsonPost ( getWslbxqurl ( ) , getClientId ( ) , json1 . toJSONString ( ) , jdbcTemplate , "0000" ) ;
String s1 = SxjgUtil . doJsonPost ( getWslbxqurl ( ) , getClientId ( ) , json1 . toJSONString ( ) , jdbcTemplate , "0000" ) ;
//根据jobResumeId获取简历附件
JSONObject jsonObject1 = new JSONObject ( ) ;
jsonObject1 . put ( "jobResumeId" , jobResumeId ) ;
String s2 = SxjgUtil . doJsonPost ( getAnnex ( ) , getClientId ( ) , json1 . toJSONString ( ) , jdbcTemplate , "0000" ) ;
if ( SxjgUtil . isSuccess ( s1 ) ) {
if ( SxjgUtil . isSuccess ( s1 ) ) {
if ( ! SxjgUtil . isSuccess ( s2 ) ) {
throw new Exception ( "简历, 头像获取失败! jobResumeId: " + jobResumeId ) ;
}
//处理批次
//处理批次
if ( ! SxjgUtil . existPc ( jobResumeId , jobNumber , jdbcTemplate ) ) {
if ( ! SxjgUtil . existPc ( jobResumeId , jobNumber , jdbcTemplate ) ) {
//成功录入批次后
//成功录入批次后
// TODO: 2023/9/15 需要调用批次录用,成功后处理
JSONObject rs = SxjgUtil . getInterfaceData ( s1 ) ;
String pcid = "" ;
JSONObject rs2 = SxjgUtil . getInterfaceData ( s2 ) ;
//录入中间表,将已经成功同步的批次记录 记录批次编号,简历编号(智联)
String encrystr1 = rs2 . getString ( "annex" ) ;
SxjgUtil . insertSyn ( jobResumeId , pcid , jobNumber , jdbcTemplate ) ;
String encrystr = rs . getString ( "detail" ) ;
String detailstr = SxjgUtil . decrypt ( this . getSecretKey ( ) , encrystr ) ;
String detailstr1 = SxjgUtil . decrypt ( this . getSecretKey ( ) , encrystr1 ) ;
JSONObject detailObj = JSONObject . parseObject ( detailstr ) ;
JSONObject detailObj1 = JSONObject . parseObject ( detailstr1 ) ;
//个人信息
JSONObject grxx = detailObj . getJSONArray ( "个人信息" ) . getJSONObject ( 0 ) ;
//联系方式
JSONObject lxfs = detailObj . getJSONArray ( "联系方式" ) . getJSONObject ( 0 ) ;
//教育经历
JSONArray jyjl = detailObj . getJSONArray ( "教育经历" ) ;
//求职意向
JSONObject qzyx = detailObj . getJSONArray ( "求职意向" ) . getJSONObject ( 0 ) ;
//实习经历
JSONArray sxjl = detailObj . getJSONArray ( "实习经历" ) ;
//项目经验
JSONArray xmjy = detailObj . getJSONArray ( "项目经验" ) ;
//奖励活动
JSONArray jlhd = detailObj . getJSONArray ( "奖励活动" ) ;
//自我评价
JSONObject zwpj = detailObj . getJSONArray ( "自我评价" ) . getJSONObject ( 0 ) ;
//技能/爱好
JSONObject jnah = detailObj . getJSONArray ( "技能/爱好" ) . getJSONObject ( 0 ) ;
//家庭关系
JSONArray jtgx = detailObj . getJSONArray ( "家庭关系" ) ;
//附件
JSONArray fj = detailObj . getJSONArray ( "附件" ) ;
//志愿信息
JSONObject zyxx = detailObj . getJSONObject ( "志愿信息" ) ;
RecruitTalentObj recruitTalentObj = new RecruitTalentObj ( ) ;
recruitTalentObj . setResumeType ( ResumeTypeEnum . XZ ) ;
//填充简历,头像
getFileObj ( detailObj1 , recruitTalentObj ) ;
recruitTalentObj . setCandidateName ( grxx . getString ( "姓名" ) ) ;
recruitTalentObj . setTelephone ( lxfs . getString ( "手机号码" ) ) ;
recruitTalentObj . setEmail ( lxfs . getString ( "电子邮箱" ) ) ;
recruitTalentObj . setGender ( grxx . getString ( "性别" ) ) ;
if ( grxx . getString ( "证件号码类型" ) . equals ( "身份证" ) ) {
recruitTalentObj . setCertificateType ( CertificateTypeEnum . SFZ ) ;
} else {
recruitTalentObj . setCertificateType ( CertificateTypeEnum . QT ) ;
}
recruitTalentObj . setCertificateNum ( grxx . getString ( "证件号码" ) ) ;
recruitTalentObj . setBirthday ( grxx . getString ( "出生日期" ) ) ;
String health = grxx . getString ( "健康状况" ) ;
if ( "良好" . equals ( health ) | | "健康" . equals ( health ) ) {
recruitTalentObj . setHealth ( HealthEnum . JK ) ;
} else {
recruitTalentObj . setHealth ( HealthEnum . QT ) ;
}
String maritalstatus = grxx . getString ( "婚姻状况" ) ;
String policicsStatus = grxx . getString ( "政治面貌" ) ;
recruitTalentObj . setMaritalStatus ( getMaritalStatusEnum ( maritalstatus ) ) ;
recruitTalentObj . setPoliticsStatus ( getPoliticsStatusEnum ( policicsStatus ) ) ;
recruitTalentObj . setNativePlace ( grxx . getString ( "籍贯" ) ) ;
//毕业日期
recruitTalentObj . setGraduateDate ( getEduDate ( jyjl ) ) ;
recruitTalentObj . setSgcm ( grxx . getString ( "身高(cm)" ) ) ;
recruitTalentObj . setWeight ( grxx . getString ( "体重(kg)" ) ) ;
recruitTalentObj . setCommunicationAdr ( lxfs . getString ( "通信地址" ) ) ;
recruitTalentObj . setEmergencyTelephone ( lxfs . getString ( "紧急联系电话" ) ) ;
recruitTalentObj . setIntendedWorkplace ( qzyx . getString ( "期望工作城市" ) ) ;
recruitTalentObj . setExpectSalary ( getExceptSalary ( qzyx . getString ( "期望月薪(税前)" ) ) ) ;
//自我评价
recruitTalentObj . setSelfDesc ( zwpj . getString ( "内容" ) ) ;
recruitTalentObj . setEnglishLevel ( EnglishLevelEnum . getByName ( jnah . getString ( "英语等级" ) ) ) ;
recruitTalentObj . setEnglishScore ( jnah . getString ( "英语分数" ) ) ;
recruitTalentObj . setOtherSkills ( jnah . getString ( "其它技能" ) ) ;
recruitTalentObj . setPersonalHobby ( jnah . getString ( "个人爱好" ) ) ;
recruitTalentObj . setIntendPosition ( zyxx . getString ( "职位名称" ) ) ;
//教育背景
recruitTalentObj . setRecruitEduExpObjList ( getEdugroudlist ( jyjl ) ) ;
//实习经历
recruitTalentObj . setRecruitSxjlObjList ( getSxjllist ( sxjl ) ) ;
//项目经验
recruitTalentObj . setRecruitProjectExpObjList ( getRecruitProjectExpObj ( xmjy ) ) ;
//获奖经历
recruitTalentObj . setRecruitAwardExpObjList ( getRecruitAwardExpObj ( jlhd ) ) ;
//语言能力
recruitTalentObj . setRecruitLanguageSkillObjList ( geRecruitLanguageSkillObj ( jnah ) ) ;
//家庭关系
recruitTalentObj . setRecruitJtgxObjList ( geRecruitJtgxObj ( jtgx ) ) ;
ObjectMapper objectMapper = new ObjectMapper ( ) ;
String jsonString = objectMapper . writeValueAsString ( recruitTalentObj ) ;
log . error ( "推送对象:" + jsonString ) ;
WeaResult wr = recruitCandidateRemoteService . createCandidateByThird ( this . getTenantKey ( ) , this . getManagerId ( ) , recruitTalentObj ) ;
log . error ( "1111111111111111111111:" + wr . getCode ( ) ) ;
log . error ( "1111111111111111111111:" + wr . getMsg ( ) ) ;
log . error ( "1111111111111111111111:" + wr . isStatus ( ) ) ;
if ( wr . getCode ( ) = = 200 ) {
JSONObject rs1 = ( JSONObject ) wr . getData ( ) ;
Long talentid = rs1 . getLong ( "talentId" ) ;
Long batchid = rs1 . getLong ( "batchId" ) ;
log . error ( "talentId:" + talentid ) ;
log . error ( "batchid:" + batchid ) ;
SxjgUtil . insertSyn ( jobResumeId , batchid . toString ( ) , jobNumber , jdbcTemplate ) ;
} else {
if ( ! wr . getMsg ( ) . contains ( "already exist" ) ) {
throw new Exception ( "录入批次失败!" ) ;
}
}
}
}
} else {
} else {
throw new Exception ( "获取简历详情失败!具体明细请看日志" ) ;
throw new Exception ( "获取简历详情失败!具体明细请看日志" ) ;
@ -427,11 +574,337 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
}
}
}
}
@Test
/ * *
* 填 充 简 历 / 头 像
* /
private void getFileObj ( JSONObject rs , RecruitTalentObj recruitTalentObj ) throws IOException {
if ( rs . containsKey ( "附件" ) ) {
JSONArray jsonArray = rs . getJSONArray ( "附件" ) ;
if ( jsonArray . size ( ) > 0 ) {
JSONObject jsonObject = jsonArray . getJSONObject ( 0 ) ;
String zjz = jsonObject . getString ( "证件照" ) ;
String jlfj = jsonObject . getString ( "简历附件" ) ;
if ( zjz . length ( ) > 0 ) {
URL url = new URL ( zjz ) ;
URLConnection connection = url . openConnection ( ) ;
InputStream i = connection . getInputStream ( ) ;
Map < String , String > rs1 = getFileNameAndTrix ( zjz ) ;
RecruitFileObj avator = new RecruitFileObj ( ) ;
avator . setExtName ( rs1 . get ( "trix" ) ) ;
avator . setFileName ( rs1 . get ( "name" ) ) ;
avator . setInputStream ( i ) ;
recruitTalentObj . setAvatar ( avator ) ;
}
if ( jlfj . length ( ) > 0 ) {
URL url = new URL ( zjz ) ;
URLConnection connection = url . openConnection ( ) ;
InputStream i = connection . getInputStream ( ) ;
Map < String , String > rs2 = getFileNameAndTrix ( jlfj ) ;
RecruitFileObj originalResume = new RecruitFileObj ( ) ;
originalResume . setExtName ( rs2 . get ( "trix" ) ) ;
originalResume . setFileName ( rs2 . get ( "name" ) ) ;
originalResume . setInputStream ( i ) ;
recruitTalentObj . setOriginalResume ( originalResume ) ;
}
}
}
}
/ * *
* 根 据 url 地 址 获 取 文 件 名 称 和 后 缀
* /
private Map < String , String > getFileNameAndTrix ( String url ) {
Map < String , String > re = new HashMap < > ( ) ;
String [ ] rs = url . split ( "/" ) ;
String str = rs [ rs . length - 1 ] ;
String [ ] result = str . split ( "\\." ) ;
String filename = result [ 0 ] ;
String filetrix = result [ 1 ] ;
re . put ( "name" , filename ) ;
re . put ( "trix" , filetrix ) ;
return re ;
}
/ * *
* 获 取 婚 姻 状 况 枚 举
* /
private MaritalStatusEnum getMaritalStatusEnum ( String name ) {
if ( "未婚" . equals ( name ) ) {
return MaritalStatusEnum . WH ;
} else if ( "已婚" . equals ( name ) ) {
return MaritalStatusEnum . YH ;
} else if ( "离异" . equals ( name ) ) {
return MaritalStatusEnum . LY ;
} else if ( "保密" . equals ( name ) ) {
return MaritalStatusEnum . BM ;
} else {
return MaritalStatusEnum . BM ;
}
}
/ * *
* 获 取 期 望 薪 资 区 间 内 一 律 取 期 望 起 始 值
* 请 选 择 # Please Select
* 1000 元 / 月 以 下 # Below 1000 RMB / Month
* 1000 ~ 2000 元 / 月 # 1000 ~ 2000 RMB / Month
* 2000 ~ 4000 元 / 月 # 2000 ~ 4000 RMB / Month
* 4000 ~ 6000 元 / 月 # 4000 ~ 6000 RMB / Month
* 6000 ~ 8000 元 / 月 # 6000 ~ 8000 RMB / Month
* 8000 ~ 10000 元 / 月 # 8000 ~ 10000 RMB / Month
* 10000 ~ 15000 元 / 月 # 10000 ~ 15000 RMB / Month
* 15000 ~ 25000 元 / 月 # 15000 ~ 25000 RMB / Month
* 25000 元 / 月 以 上 # Above 25000 RMB / Month
* /
private String getExceptSalary ( String s ) {
String finstr = "" ;
if ( s . contains ( "元/月" ) ) {
String s1 = s . split ( "元/月" ) [ 0 ] ;
if ( s1 . contains ( "~" ) ) {
finstr = s1 . split ( "~" ) [ 0 ] ;
} else {
finstr = s1 ;
}
}
if ( finstr . length ( ) > 0 ) {
try {
BigDecimal q1 = new BigDecimal ( finstr ) ;
BigDecimal q2 = q1 . divide ( new BigDecimal ( "1000" ) ) ;
return q2 . toString ( ) ;
} catch ( Exception e ) { return "" ; }
} else {
return "" ;
}
}
/ * *
* 获 取 婚 姻 状 况 枚 举
* /
private PoliticsStatusEnum getPoliticsStatusEnum ( String name ) {
if ( "团员" . equals ( name ) ) {
return PoliticsStatusEnum . TY ;
} else if ( "中共党员(含预备党员)" . equals ( name ) ) {
return PoliticsStatusEnum . ZGDY ;
} else if ( "民主党派" . equals ( name ) ) {
return PoliticsStatusEnum . MZDP ;
} else if ( "无党派人士" . equals ( name ) ) {
return PoliticsStatusEnum . WDPRS ;
} else if ( "群众" . equals ( name ) ) {
return PoliticsStatusEnum . QZ ;
} else {
return PoliticsStatusEnum . QZ ;
}
}
/ * *
* 根 据 教 育 经 历 获 取 最 高 毕 业 时 间
* /
public String getEduDate ( JSONArray rs ) throws ParseException {
if ( rs ! = null & & rs . size ( ) > 0 ) {
SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd" ) ;
List < Long > li = new ArrayList ( ) ;
for ( int i = 0 ; i < rs . size ( ) ; i + + ) {
JSONObject obj = rs . getJSONObject ( i ) ;
String date = obj . getString ( "毕业时间" ) ;
Date r = sdf . parse ( date ) ;
li . add ( r . getTime ( ) ) ;
}
long t = Collections . max ( li ) ;
Date s = new Date ( t ) ;
return sdf . format ( s ) ;
} else {
return null ;
}
}
/ * *
* 获 取 教 育 经 历
* /
private List < RecruitEduExpObj > getEdugroudlist ( JSONArray rs ) {
List < RecruitEduExpObj > list = new ArrayList < > ( ) ;
if ( rs ! = null & & rs . size ( ) > 0 ) {
for ( int i = 0 ; i < rs . size ( ) ; i + + ) {
RecruitEduExpObj recruitEduExpObj = new RecruitEduExpObj ( ) ;
JSONObject obj = rs . getJSONObject ( i ) ;
recruitEduExpObj . setSchool ( obj . getString ( "学校名称" ) ) ;
recruitEduExpObj . setStudyDate0 ( obj . getString ( "入学时间" ) ) ;
recruitEduExpObj . setStudyDate1 ( obj . getString ( "毕业时间" ) ) ;
if ( EducationTypeEnum . getByName ( obj . getString ( "受教育类型" ) ) = = null ) {
recruitEduExpObj . setEducationType ( EducationTypeEnum . QRZTFZP ) ;
} else {
recruitEduExpObj . setEducationType ( EducationTypeEnum . getByName ( obj . getString ( "受教育类型" ) ) ) ;
}
recruitEduExpObj . setEduEducation ( getEducationTrans ( obj . getString ( "学历" ) ) ) ;
recruitEduExpObj . setDegree ( getdegreenum ( obj . getString ( "学位" ) ) ) ;
recruitEduExpObj . setResearchDirection ( obj . getString ( "研究方向" ) ) ;
recruitEduExpObj . setFaculty ( obj . getString ( "院系" ) ) ;
recruitEduExpObj . setEduMajor ( obj . getString ( "专业" ) ) ;
recruitEduExpObj . setMajorCourses ( obj . getString ( "专业课程" ) ) ;
if ( obj . containsKey ( "海外工作/学习经历" ) & & obj . getString ( "海外工作/学习经历" ) . length ( ) > 0 ) {
if ( "是" . equals ( obj . getString ( "海外工作/学习经历" ) ) ) {
recruitEduExpObj . setOverseasExperience ( BooleanEnum . TRUE ) ;
} else {
recruitEduExpObj . setOverseasExperience ( BooleanEnum . FALSE ) ;
}
}
list . add ( recruitEduExpObj ) ;
}
return list ;
} else {
return null ;
}
}
/ * *
* 获 取 学 位 枚 举
* /
private DegreeEnum getdegreenum ( String name ) {
if ( DegreeEnum . getByName ( name ) = = null ) {
return DegreeEnum . W ;
} else {
return DegreeEnum . getByName ( name ) ;
}
}
/ * *
* 获 取 学 历 学 位 : 0 - 博 士 , 1 - MBA , 2 - 硕 士 , 3 - 双 学 士 , 4 - 学 士 , 5 - 其 他 , 6 - 无
* /
public String getEducationTrans ( String name ) {
if ( "博士" . equals ( name ) ) {
return "0" ;
} else if ( "MBA" . equals ( name ) ) {
return "1" ;
} else if ( "硕士" . equals ( name ) ) {
return "2" ;
} else if ( "双学士" . equals ( name ) ) {
return "3" ;
} else if ( "学士" . equals ( name ) ) {
return "4" ;
} else if ( "其他" . equals ( name ) ) {
return "5" ;
} else if ( "无" . equals ( name ) ) {
return "6" ;
} else {
return "5" ;
}
}
/ * *
*
* /
private List < RecruitSxjlObj > getSxjllist ( JSONArray jsonArray ) {
List < RecruitSxjlObj > list = new ArrayList < > ( ) ;
if ( jsonArray ! = null & & jsonArray . size ( ) > 0 ) {
for ( int i = 0 ; i < jsonArray . size ( ) ; i + + ) {
RecruitSxjlObj recruitSxjlObj = new RecruitSxjlObj ( ) ;
JSONObject jsonObject = jsonArray . getJSONObject ( i ) ;
recruitSxjlObj . setSxCoName ( jsonObject . getString ( "工作单位" ) ) ;
recruitSxjlObj . setEntryTime ( jsonObject . getString ( "入职时间" ) ) ;
recruitSxjlObj . setSxWorkType ( WorkTypeEnum . getByName ( jsonObject . getString ( "工作类型" ) ) ) ;
recruitSxjlObj . setSxWorkSalary ( jsonObject . getString ( "职位月薪(税前)" ) ) ;
recruitSxjlObj . setPositionJob ( jsonObject . getString ( "职务" ) ) ;
recruitSxjlObj . setJobDescription ( jsonObject . getString ( "工作描述" ) ) ;
list . add ( recruitSxjlObj ) ;
}
return list ;
} else {
return null ;
}
}
//项目经验
private List < RecruitProjectExpObj > getRecruitProjectExpObj ( JSONArray jsonArray ) {
List < RecruitProjectExpObj > list = new ArrayList < > ( ) ;
if ( jsonArray ! = null & & jsonArray . size ( ) > 0 ) {
for ( int i = 0 ; i < jsonArray . size ( ) ; i + + ) {
RecruitProjectExpObj recruitProjectExpObj = new RecruitProjectExpObj ( ) ;
JSONObject jsonObject = jsonArray . getJSONObject ( i ) ;
recruitProjectExpObj . setPjName ( jsonObject . getString ( "项目名称" ) ) ;
recruitProjectExpObj . setPjDate0 ( jsonObject . getString ( "项目开始时间" ) ) ;
recruitProjectExpObj . setPjDate1 ( jsonObject . getString ( "项目结束时间" ) ) ;
recruitProjectExpObj . setPjIntroduction ( jsonObject . getString ( "项目简述" ) ) ;
recruitProjectExpObj . setPjDuty ( jsonObject . getString ( "职务" ) ) ;
recruitProjectExpObj . setPjRole ( jsonObject . getString ( "项目职责" ) ) ;
list . add ( recruitProjectExpObj ) ;
}
return list ;
} else {
return null ;
}
}
//获奖经历
private List < RecruitAwardExpObj > getRecruitAwardExpObj ( JSONArray jsonArray ) {
List < RecruitAwardExpObj > list = new ArrayList < > ( ) ;
if ( jsonArray ! = null & & jsonArray . size ( ) > 0 ) {
for ( int i = 0 ; i < jsonArray . size ( ) ; i + + ) {
RecruitAwardExpObj recruitAwardExpObj = new RecruitAwardExpObj ( ) ;
JSONObject jsonObject = jsonArray . getJSONObject ( i ) ;
recruitAwardExpObj . setStudentLeader ( BooleanEnum . getByName ( jsonObject . getString ( "是否学生干部" ) ) ) ;
recruitAwardExpObj . setCadreRank ( CadreRankEnum . getByName ( jsonObject . getString ( "干部级别" ) ) ) ;
if ( CadreNameEnum . getByName ( jsonObject . getString ( "干部名称" ) ) = = null ) {
recruitAwardExpObj . setCadreName ( CadreNameEnum . QT ) ;
} else {
recruitAwardExpObj . setCadreName ( CadreNameEnum . getByName ( jsonObject . getString ( "干部名称" ) ) ) ;
}
recruitAwardExpObj . setStartDate ( jsonObject . getString ( "开始时间" ) ) ;
recruitAwardExpObj . setEndDate ( jsonObject . getString ( "结束时间" ) ) ;
recruitAwardExpObj . setAwarded ( jsonObject . getString ( "受到奖励" ) ) ;
recruitAwardExpObj . setCredentials ( jsonObject . getString ( "专业资格证书" ) ) ;
recruitAwardExpObj . setSchoolActivities ( jsonObject . getString ( "校内活动" ) ) ;
list . add ( recruitAwardExpObj ) ;
}
return list ;
} else {
return null ;
}
}
//语言能力
private List < RecruitLanguageSkillObj > geRecruitLanguageSkillObj ( JSONObject jsonobj ) {
JSONArray jsonArray = jsonobj . getJSONArray ( "语言能力" ) ;
List < RecruitLanguageSkillObj > list = new ArrayList < > ( ) ;
if ( jsonArray ! = null & & jsonArray . size ( ) > 0 ) {
for ( int i = 0 ; i < jsonArray . size ( ) ; i + + ) {
RecruitLanguageSkillObj recruitLanguageSkillObj = new RecruitLanguageSkillObj ( ) ;
JSONObject jsonObject = jsonArray . getJSONObject ( i ) ;
recruitLanguageSkillObj . setLanguageType ( jsonObject . getString ( "语言能力" ) ) ;
recruitLanguageSkillObj . setLsAbility ( AbilityEnum . getByName ( jsonObject . getString ( "听说能力" ) ) ) ;
recruitLanguageSkillObj . setLiteracy ( AbilityEnum . getByName ( jsonObject . getString ( "读写能力" ) ) ) ;
list . add ( recruitLanguageSkillObj ) ;
}
return list ;
} else {
return null ;
}
}
//家庭关系
private List < RecruitJtgxObj > geRecruitJtgxObj ( JSONArray jsonArray ) {
List < RecruitJtgxObj > list = new ArrayList < > ( ) ;
if ( jsonArray ! = null & & jsonArray . size ( ) > 0 ) {
for ( int i = 0 ; i < jsonArray . size ( ) ; i + + ) {
RecruitJtgxObj recruitJtgxObj = new RecruitJtgxObj ( ) ;
JSONObject jsonObject = jsonArray . getJSONObject ( i ) ;
recruitJtgxObj . setRelativesName ( jsonObject . getString ( "亲属姓名" ) ) ;
recruitJtgxObj . setKinship ( jsonObject . getString ( "亲属关系" ) ) ;
recruitJtgxObj . setRelativesWork ( jsonObject . getString ( "亲属工作单位" ) ) ;
recruitJtgxObj . setRelativesPosition ( jsonObject . getString ( "亲属职位" ) ) ;
list . add ( recruitJtgxObj ) ;
}
return list ;
} else {
return null ;
}
}
// @Test
// public void test1(){
// public void test1(){
// DataSource db = DataSourceBuilder.create().driverClassName("com.mysql.cj.jdbc.Driver").username("ecology").password("uxJhLJn4%NpWxujAYyKsTpxP").url("jdbc:mysql://10.70.11.12:3306/ec_ebuilder_designer?characterEncoding=utf8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true").build();
// DataSource db = DataSourceBuilder.create().driverClassName("com.mysql.cj.jdbc.Driver").username("ecology").password("uxJhLJn4%NpWxujAYyKsTpxP").url("jdbc:mysql://10.70.11.12:3306/ec_ebuilder_designer?characterEncoding=utf8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true").build();
// JdbcTemplate jdbcTemplate = new JdbcTemplate(db);
// JdbcTemplate jdbcTemplate = new JdbcTemplate(db);
// refreshToken(jdbcTemplate,"0000");
// refreshToken(jdbcTemplate,"0000");
// }
// private void testtb(JdbcTemplate jdbcTemplate) throws Exception {
// JSONArray jsonArray = new JSONArray();
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("jobResumeId","109645236");
// jsonObject.put("resumeNumber","109645236");
// jsonArray.add(jsonObject);
// dealJsonArrayGetDetail(jsonArray,"","liuhaotest111",jdbcTemplate);
// }
// }
private boolean refreshToken ( JdbcTemplate jdbcTemplate , String orgcodes ) {
private boolean refreshToken ( JdbcTemplate jdbcTemplate , String orgcodes ) {
@ -549,4 +1022,35 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
public void setWslbxqurl ( String wslbxqurl ) {
public void setWslbxqurl ( String wslbxqurl ) {
this . wslbxqurl = wslbxqurl ;
this . wslbxqurl = wslbxqurl ;
}
}
public String getSecretKey ( ) {
return secretKey ;
}
public void setSecretKey ( String secretKey ) {
this . secretKey = secretKey ;
}
public String getTenantKey ( ) {
return tenantKey ;
}
public void setTenantKey ( String tenantKey ) {
this . tenantKey = tenantKey ;
}
public String getManagerId ( ) {
return managerId ;
}
public void setManagerId ( String managerId ) {
this . managerId = managerId ;
}
public String getAnnex ( ) {
return annex ;
}
public void setAnnex ( String annex ) {
this . annex = annex ;
}
}
}