generated from dxfeng/secondev-chapanda-feishu
122 lines
3.4 KiB
Java
122 lines
3.4 KiB
Java
|
|
package com.engine.recruit.entity.resume;
|
|||
|
|
|
|||
|
|
import cn.hutool.core.convert.Convert;
|
|||
|
|
import cn.hutool.http.HttpRequest;
|
|||
|
|
import cn.hutool.http.HttpResponse;
|
|||
|
|
import com.alibaba.fastjson.JSON;
|
|||
|
|
import com.alibaba.fastjson.JSONArray;
|
|||
|
|
import com.alibaba.fastjson.JSONObject;
|
|||
|
|
import com.engine.recruit.conn.ModeBrowserCommonInfo;
|
|||
|
|
import lombok.AllArgsConstructor;
|
|||
|
|
import lombok.Builder;
|
|||
|
|
import lombok.Data;
|
|||
|
|
import lombok.NoArgsConstructor;
|
|||
|
|
import org.apache.commons.lang3.StringUtils;
|
|||
|
|
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
|||
|
|
import weaver.general.BaseBean;
|
|||
|
|
import weaver.hrm.User;
|
|||
|
|
|
|||
|
|
import java.io.InputStream;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @author:dxfeng
|
|||
|
|
* @createTime: 2023/11/10
|
|||
|
|
* @version: 1.0
|
|||
|
|
*/
|
|||
|
|
@Data
|
|||
|
|
@AllArgsConstructor
|
|||
|
|
@NoArgsConstructor
|
|||
|
|
@Builder
|
|||
|
|
public class QllResumePo {
|
|||
|
|
private static final int SEC_CATEGORY = Convert.toInt(RecruitModeUtil.getRecruitPropValue("APPLICANTS_RESUMES_CATEGORY"));
|
|||
|
|
|
|||
|
|
private String id;
|
|||
|
|
private String xm;
|
|||
|
|
private String xb;
|
|||
|
|
private String nl;
|
|||
|
|
private String gzjy;
|
|||
|
|
private String xjzd;
|
|||
|
|
private String sjhm;
|
|||
|
|
private String yx;
|
|||
|
|
private String ypzw;
|
|||
|
|
private String grys;
|
|||
|
|
private String qzyx;
|
|||
|
|
private String gzjl;
|
|||
|
|
private String xmjl;
|
|||
|
|
private String jyjl;
|
|||
|
|
private String zgxl;
|
|||
|
|
private String zyjn;
|
|||
|
|
private String yynl;
|
|||
|
|
private String zs;
|
|||
|
|
private String jlfj;
|
|||
|
|
private String rksj;
|
|||
|
|
private String tdsj;
|
|||
|
|
private String lyqd;
|
|||
|
|
private String gjrsjh;
|
|||
|
|
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 解析JSON数组,下载文件并入库
|
|||
|
|
*
|
|||
|
|
* @return
|
|||
|
|
*/
|
|||
|
|
public String getJlfj() {
|
|||
|
|
if (StringUtils.isBlank(jlfj)) {
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
String resumeId = null;
|
|||
|
|
try {
|
|||
|
|
JSONArray jsonArray = JSON.parseArray(jlfj);
|
|||
|
|
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
|
|||
|
|
String name = jsonObject.getString("name");
|
|||
|
|
String content = jsonObject.getString("content");
|
|||
|
|
HttpResponse response = HttpRequest.get(content).execute();
|
|||
|
|
if (response.isOk()) {
|
|||
|
|
String disposition = response.header("Content-Disposition");
|
|||
|
|
if (StringUtils.isNotBlank(disposition)) {
|
|||
|
|
InputStream inputStream = response.bodyStream();
|
|||
|
|
int imageFileId = RecruitModeUtil.generateImageFileId(inputStream, name);
|
|||
|
|
int docId = RecruitModeUtil.createDocId(SEC_CATEGORY, imageFileId, new User(1));
|
|||
|
|
resumeId = String.valueOf(docId);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
} catch (Exception e) {
|
|||
|
|
new BaseBean().writeLog("千里聆附件下载失败", e);
|
|||
|
|
}
|
|||
|
|
return resumeId;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public String getLyqd() {
|
|||
|
|
return ModeBrowserCommonInfo.getResumeSource(lyqd);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public String getXb() {
|
|||
|
|
if ("男".equals(xb)) {
|
|||
|
|
return "0";
|
|||
|
|
} else if ("女".equals(xb)) {
|
|||
|
|
return "1";
|
|||
|
|
}
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public String getGzjy() {
|
|||
|
|
if (StringUtils.isBlank(gzjy)) {
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
;
|
|||
|
|
int parseInt = Integer.parseInt(gzjy);
|
|||
|
|
String year = parseInt + "年";
|
|||
|
|
if (0 == parseInt) {
|
|||
|
|
year = "1年以内";
|
|||
|
|
}
|
|||
|
|
if (parseInt > 20) {
|
|||
|
|
year = "20年以上";
|
|||
|
|
}
|
|||
|
|
return ModeBrowserCommonInfo.getResumeSource(year);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public String getZgxl() {
|
|||
|
|
return ModeBrowserCommonInfo.getEducationLevelId(zgxl);
|
|||
|
|
}
|
|||
|
|
}
|