Commit 3fd1fd88 authored by 霍传世's avatar 霍传世

1.面试过程状态接口 status=面试状态 届时是用来描述是否面试结束 status_commitment 届时是用来描述承诺书是否签署完成 上传成功

2.登录接口 增加承诺书和面试状态 如上
3.回调接口修改 haina面试结束 回调事件 触发status=1的状态修改
parent c4d10004
......@@ -14,6 +14,4 @@ public class HaiNaFaceToFaceAiApplication {
SpringApplication.run(HaiNaFaceToFaceAiApplication.class, args);
logger.info("海纳面试启动成功");
}
}
......@@ -26,6 +26,14 @@ public class CallBackApiController {
String candidateConnectCode = result.getString("candidateConnectCode");
log.info("候选人链接码"+candidateConnectCode+"面试过程回调"+data);
String event = result.getString("event");
if(event.equals("aiExamCandidateEnd")){
try{
DBOperator.update("update candidate_exam set status = 1 where candidate_connect_code = ?",new Object[]{candidateConnectCode});
log.info("候选人链接码"+candidateConnectCode+"面试完成状态完成");
}catch (Exception e){
log.info("候选人链接码"+candidateConnectCode+"面试完成回调出错");
}
}
if(event.equals("aiExamCandidateReviewV2")){
try{
DBOperator.update("update candidate_exam set result_back = 1,interview_results = ? where candidate_connect_code = ?",new Object[]{data,candidateConnectCode});
......@@ -40,7 +48,6 @@ public class CallBackApiController {
jsonObject.put("message","回到数据解析出错");
return ResponseEntity.ok(jsonObject.toString());
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("code",0);
jsonObject.put("message","收到回调");
......
......@@ -35,7 +35,9 @@ public class LoginController {
"\ta.zkz_num, \n" +
"\tb.id_card, \n" +
"\ta.exam_connect_code, \n" +
"\ta.candidate_connect_code \n" +
"\ta.candidate_connect_code, \n" +
"\ta.status_commitment, \n" +
"\ta.status \n" +
"FROM\n" +
"\tcandidate_exam a join \n" +
"\tcandidate b on a.id_card = b.id_card \n" +
......
......@@ -3,22 +3,49 @@ package com.yuda.hainafacetofaceai.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yuda.hainafacetofaceai.constant.CosConstant;
import com.yuda.hainafacetofaceai.entity.CandidateExam;
import com.yuda.hainafacetofaceai.util.CosUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
@RestController
@RequestMapping("/publicApi")
public class PublicFunctionController {
@Autowired
private CosUtil cosUtil;
@Autowired
private JdbcTemplate DBOperator;
@RequestMapping("/getWebCosSign")
public ResponseEntity getWebCosTempSign() throws Exception {
String tempSignBody = cosUtil.getSignatureForWeb(CosConstant.COS_BUCKET,CosConstant.COS_ENDPOINT);
JSONObject jsonObject = JSON.parseObject(tempSignBody);
return ResponseEntity.ok(jsonObject);
}
@RequestMapping("/getProcessStatus/{examConnectCode}/{zkzNum}")
public ResponseEntity getStatusFaceHaiNa(@PathVariable String examConnectCode,@PathVariable String zkzNum) {
try{
CandidateExam candidateExam = DBOperator.queryForObject("select status_commitment,status from candidate_exam where zkz_num = ? and exam_connect_code =?",new BeanPropertyRowMapper<>(CandidateExam.class),zkzNum,examConnectCode);
return ResponseEntity.ok(new JSONObject(new HashMap<String,Object>(){{
put("code",200);
put("message","查询成功");
put("data",new JSONObject(){{
put("status",candidateExam.getStatus());
put("status_commitment",candidateExam.getStatusCommitment());
}});
}}));
}catch (Exception e){
e.printStackTrace();
return ResponseEntity.ok(new JSONObject(new HashMap<String,Object>(){{
put("code",200);
put("message","该面试者状态有误");
}}));
}
}
}
......@@ -24,6 +24,7 @@ public class CandidateExam {
private String interviewResults;
private Integer resultBack;
private Integer reportDone;
private Integer status;
private DateTime updateTime;
private DateTime createTime;
}
package com.yuda.hainafacetofaceai.util;
import com.yuda.hainafacetofaceai.constant.AppStaticParams;
import com.yuda.hainafacetofaceai.constant.AppThirdPartUrls;
import com.yuda.hainafacetofaceai.entity.CandidateExam;
import lombok.extern.slf4j.Slf4j;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
......@@ -20,9 +10,6 @@ import java.security.NoSuchAlgorithmException;
@Slf4j
public class AppUtil {
@Autowired
private RestTemplate restTemplate;
public String ApiUrlGen(String url){
String timestamp = String.valueOf(System.currentTimeMillis());
timestamp = timestamp.substring(0, 10);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment