generated from dxfeng/secondev-chapanda-feishu
TODO-头像识别,简历列表卡片
This commit is contained in:
parent
c6535a35e1
commit
b0663aee2f
|
|
@ -10,6 +10,7 @@ import weaver.hrm.User;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
|
|
@ -83,4 +84,31 @@ public class ApplicantResumeController {
|
|||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::checkRepeatResume, param);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getResumeCardInfo")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getResumeCardInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::getResumeCardInfo, param);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getResumeListStatus")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getResumeListStatus(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::getResumeListStatus, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/updateResumeListStatus")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String updateResumeListStatus(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::updateResumeListStatus, param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ public interface ApplicantResumeService {
|
|||
Map<String, Object> updateApplicantsInfo(Map<String, Object> params);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 判断是否重复简历,是否可以新增
|
||||
*
|
||||
|
|
@ -63,4 +62,28 @@ public interface ApplicantResumeService {
|
|||
* @return
|
||||
*/
|
||||
Map<String, Object> checkRepeatResume(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 获取简历卡片信息
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getResumeCardInfo(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 获取简历列表状态
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getResumeListStatus(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 更新简历列表状态
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> updateResumeListStatus(Map<String, Object> param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -369,6 +369,25 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
|
|||
return returnMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getResumeCardInfo(Map<String, Object> param) {
|
||||
String billId = Util.null2String(param.get("billId"));
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
|
||||
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getResumeListStatus(Map<String, Object> param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> updateResumeListStatus(Map<String, Object> param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建普通数据格式
|
||||
*
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import org.apache.commons.collections.CollectionUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||
|
|
@ -27,6 +28,7 @@ import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
|||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
|
@ -151,11 +153,16 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
JSONObject result = resultall.getJSONObject("result");
|
||||
baseBean.writeLog("千里聆OCR解析数据:" + result);
|
||||
Map<String, Object> dataMap = parseQllJsonToMapV2(result, isCard);
|
||||
//TODO 解析图片信息
|
||||
String faceId = resultall.getString("face_id");
|
||||
if (StringUtils.isNotBlank(faceId)) {
|
||||
String faceUrl = RecruitConstant.OCR_URL.replace("/resume", "/common/get_image");
|
||||
// 请求接口
|
||||
}
|
||||
returnMap.put("data", dataMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 千里聆解析字段内容处理(V2)
|
||||
*
|
||||
|
|
@ -178,7 +185,7 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
dataMap.put("sjhm", sjhm);
|
||||
// 年龄
|
||||
String nl = personalInformation.getString("年龄");
|
||||
if(StringUtils.isNotBlank(nl)) {
|
||||
if (StringUtils.isNotBlank(nl)) {
|
||||
dataMap.put("nl", nl);
|
||||
}
|
||||
// 出生日期
|
||||
|
|
@ -188,9 +195,9 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
String xb = personalInformation.getString("性别");
|
||||
if ("女".equals(xb)) {
|
||||
dataMap.put("xb", 1);
|
||||
} else if("男".equals(xb)){
|
||||
} else if ("男".equals(xb)) {
|
||||
dataMap.put("xb", 0);
|
||||
}else{
|
||||
} else {
|
||||
dataMap.put("xb", null);
|
||||
}
|
||||
// 体重(KG)
|
||||
|
|
@ -232,7 +239,7 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
|
||||
// 工作经验
|
||||
String gzjyStr = personalInformation.getString("工作经验");
|
||||
if(StringUtils.isNotBlank(gzjyStr)) {
|
||||
if (StringUtils.isNotBlank(gzjyStr)) {
|
||||
if (gzjyStr.contains("到")) {
|
||||
String[] split = gzjyStr.split("到");
|
||||
if (split.length == 2) {
|
||||
|
|
@ -337,8 +344,8 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
String startDate = getFormatDate(o.getString("开始时间"));
|
||||
String endDate = getFormatDate(o.getString("结束时间"));
|
||||
RecruitDataMap<Object> projectMap = new RecruitDataMap<>();
|
||||
projectMap.put("kssj",startDate);
|
||||
projectMap.put("jssj",endDate);
|
||||
projectMap.put("kssj", startDate);
|
||||
projectMap.put("jssj", endDate);
|
||||
projectMap.put("xmmc", o.getString("项目名称"));
|
||||
projectMap.put("drjs", o.getString("担任角色"));
|
||||
projectMap.put("xmms", o.getString("项目描述"));
|
||||
|
|
@ -390,6 +397,34 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
}
|
||||
}
|
||||
|
||||
private InputStream getImageFile(String faceUrl, String filename) {
|
||||
try {
|
||||
String appId = RecruitConstant.APP_ID;
|
||||
String appSecret = RecruitConstant.APP_SECRET;
|
||||
long currentTime = System.currentTimeMillis();
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
|
||||
HttpGet httpGet = new HttpGet(faceUrl);
|
||||
httpGet.addHeader("sign", getSign(appId, appSecret, currentTime));
|
||||
httpGet.addHeader("appId", appId);
|
||||
httpGet.addHeader("timestamp", String.valueOf(currentTime));
|
||||
|
||||
// 执行请求并获取响应
|
||||
try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
|
||||
// 检查响应状态
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
// 获取响应实体
|
||||
return response.getEntity().getContent();
|
||||
} else {
|
||||
throw new CustomizeRunTimeException(String.valueOf(response.getStatusLine().getStatusCode()));
|
||||
//System.out.println("GET request failed. Response Code: " + response.getStatusLine().getStatusCode());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new CustomizeRunTimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 千里聆签名
|
||||
|
|
@ -421,7 +456,6 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 转换日期对象
|
||||
*
|
||||
|
|
|
|||
|
|
@ -42,4 +42,16 @@ public class ApplicantResumeWrapper extends Service {
|
|||
public Map<String, Object> checkRepeatResume(Map<String, Object> params) {
|
||||
return getApplicantResumeService(user).checkRepeatResume(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> getResumeCardInfo(Map<String, Object> params) {
|
||||
return getApplicantResumeService(user).getResumeCardInfo(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> getResumeListStatus(Map<String, Object> params) {
|
||||
return getApplicantResumeService(user).getResumeListStatus(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> updateResumeListStatus(Map<String, Object> params) {
|
||||
return getApplicantResumeService(user).updateResumeListStatus(params);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue