Commit 90d67102 authored by star's avatar star

修改代码

parent 3ce4cb76
......@@ -4,9 +4,9 @@
<option name="projectProfile">
<ProjectProfile>
<option name="javaMapperPackage" value="com.takedata.resume.dao" />
<option name="javaMapperPath" value="$PROJECT_DIR$/src/main/java" />
<option name="javaMapperPath" value="C:\Users\86187\Desktop\resume\sql" />
<option name="javaModelPackage" value="com.takedata.resume.model" />
<option name="javaModelPath" value="$PROJECT_DIR$/src/main/java" />
<option name="javaModelPath" value="C:\Users\86187\Desktop\resume\sql" />
<option name="lastDatabaseCrudChooseModuleName" value="resume" />
<option name="moduleNameToPackageAndPathMap">
<map>
......@@ -14,11 +14,11 @@
<value>
<UserPackageAndPathInfoByModule>
<option name="javaMapperPackage" value="com.takedata.resume.dao" />
<option name="javaMapperPath" value="$PROJECT_DIR$/src/main/java" />
<option name="javaMapperPath" value="C:\Users\86187\Desktop\resume\sql" />
<option name="javaModelPacakge" value="com.takedata.resume.model" />
<option name="javaModelPath" value="$PROJECT_DIR$/src/main/java" />
<option name="javaModelPath" value="C:\Users\86187\Desktop\resume\sql" />
<option name="xmlPackage" value="mapper" />
<option name="xmlPath" value="$PROJECT_DIR$/src/main/resources" />
<option name="xmlPath" value="C:\Users\86187\Desktop\resume\sql" />
</UserPackageAndPathInfoByModule>
</value>
</entry>
......@@ -36,10 +36,22 @@
</TableGenerateConfig>
</value>
</entry>
<entry key="forprogrammers_n:zc_synchronize">
<value>
<TableGenerateConfig>
<option name="generatedKey" value="id" />
<option name="javaModelName" value="ZcSynchronize" />
<option name="moduleName" value="resume" />
<option name="sequenceColumn" value="" />
<option name="sequenceId" value="" />
<option name="useActualColumnName" value="false" />
</TableGenerateConfig>
</value>
</entry>
</map>
</option>
<option name="xmlMapperPackage" value="mapper" />
<option name="xmlMapperPath" value="$PROJECT_DIR$/src/main/resources" />
<option name="xmlMapperPath" value="C:\Users\86187\Desktop\resume\sql" />
</ProjectProfile>
</option>
</component>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List;
import java.util.Map;
......@@ -63,12 +65,24 @@ public class ResumeSdkController {
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "phone", required = false) String phone,
@RequestParam int pageNum, @RequestParam int pageSize,
@RequestParam(value = "createBy", required = false) Long createBy) {
@RequestParam(value = "createBy", required = false) Long createBy) throws UnsupportedEncodingException {
if(keywords!=null){
keywords = URLDecoder.decode(keywords,"UTF-8");
}
if(label!=null){
label = URLDecoder.decode(label,"UTF-8");
}
if(expectJob!=null){
expectJob = URLDecoder.decode(expectJob,"UTF-8");
}
if(name!=null){
name = URLDecoder.decode(name,"UTF-8");
}
return resumeService.resumeSearch(keywords, label, name, expectJob, phone, pageNum, pageSize, createBy);
}
/**
*
* 任务搜索
* @param keywords
* @param label
* @param expectJob
......@@ -90,7 +104,22 @@ public class ResumeSdkController {
@RequestParam int pageNum, @RequestParam int pageSize,
@RequestParam(value = "createBy", required = false) Long createBy,
@RequestParam(value = "interviewerName", required = false) String interviewerName,
@RequestParam(value = "status" , required = false) Integer status) {
@RequestParam(value = "status" , required = false) Integer status) throws UnsupportedEncodingException {
if(keywords!=null){
keywords = URLDecoder.decode(keywords,"UTF-8");
}
if(label!=null){
label = URLDecoder.decode(label,"UTF-8");
}
if(expectJob!=null){
expectJob = URLDecoder.decode(expectJob,"UTF-8");
}
if(name!=null){
name = URLDecoder.decode(name,"UTF-8");
}
if(interviewerName!=null){
interviewerName = URLDecoder.decode(interviewerName,"UTF-8");
}
return resumeService.taskSearch(keywords, label, name, expectJob, phone, pageNum, pageSize, createBy, interviewerName, status);
}
}
\ No newline at end of file
......@@ -22,7 +22,4 @@ public interface ZcResumeMapper {
int updateByPrimaryKey(ZcResume record);
ZcResume selectOneByResumeLink(@Param("resumeLink")String resumeLink);
}
\ No newline at end of file
package com.takedata.resume.dao;
import com.takedata.resume.model.ZcSynchronize;
/**
* @author lichen
*/
public interface ZcSynchronizeMapper {
/**
* 添加同步记录
* @param record
* @return
*/
int insertSelective(ZcSynchronize record);
}
\ No newline at end of file
package com.takedata.resume.model;
public class ZcSynchronize {
private Integer id;
/**
* 简历id
*/
private Integer resumeId;
/**
* 简历中的姓名
*/
private String name;
/**
* 简历中的手机号
*/
private String phone;
/**
* 简历解析内容
*/
private String rawText;
/**
* 期望工作岗位
*/
private String expectJob;
/**
* 简历标签
*/
private String label;
private Long createBy;
/**
* 面试官名称
*/
private String interviewerName;
/**
* 简历状态
*/
private Byte status;
/**
* 简历oss路径
*/
private String resumeLink;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getResumeId() {
return resumeId;
}
public void setResumeId(Integer resumeId) {
this.resumeId = resumeId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getRawText() {
return rawText;
}
public void setRawText(String rawText) {
this.rawText = rawText;
}
public String getExpectJob() {
return expectJob;
}
public void setExpectJob(String expectJob) {
this.expectJob = expectJob;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public Long getCreateBy() {
return createBy;
}
public void setCreateBy(Long createBy) {
this.createBy = createBy;
}
public String getInterviewerName() {
return interviewerName;
}
public void setInterviewerName(String interviewerName) {
this.interviewerName = interviewerName;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public String getResumeLink() {
return resumeLink;
}
public void setResumeLink(String resumeLink) {
this.resumeLink = resumeLink;
}
}
\ No newline at end of file
......@@ -5,9 +5,11 @@ import com.takedata.resume.api.TestParseService;
import com.takedata.resume.common.Paging;
import com.takedata.resume.common.Response;
import com.takedata.resume.dao.ZcResumeMapper;
import com.takedata.resume.dao.ZcSynchronizeMapper;
import com.takedata.resume.model.ResumeResult;
import com.takedata.resume.common.utils.OssFileUtils;
import com.takedata.resume.model.ZcResume;
import com.takedata.resume.model.ZcSynchronize;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
......@@ -41,6 +43,9 @@ public class ResumeService {
@Autowired
private ZcResumeMapper zcResumeMapper;
@Autowired
private ZcSynchronizeMapper zcSynchronizeMapper;
/**
* 简历解析
*
......@@ -49,14 +54,7 @@ public class ResumeService {
* @return
*/
public Object resumeAnalysis(String objectName, String fileName, Long createBy) {
ZcResume zcResume1 = zcResumeMapper.selectOneByResumeLink(objectName);
if (zcResume1 != null) {
return Response.no(400);
}
byte[] bytes = OssFileUtils.ossDownload(objectName);
//mds去重(同一简历上传多次)
String md5DigestAsHex = DigestUtils.md5DigestAsHex(bytes);
//简历解析
Response<ResumeResult> resumeResultResponse = TestParseService.testResumeParser(bytes, fileName);
ResumeResult data = resumeResultResponse.getData();
......@@ -82,6 +80,18 @@ public class ResumeService {
//oss链接
zcResume.setResumeLink(objectName);
zcResumeMapper.insertSelective(zcResume);
//添加同步记录
ZcSynchronize zc = new ZcSynchronize();
zc.setName(data.getName());
zc.setCreateBy(createBy);
zc.setExpectJob(data.getExpect_job());
zc.setRawText(data.getRaw_text());
zc.setLabel("");
zc.setResumeId(zcResume.getId());
zc.setResumeLink(objectName);
zcSynchronizeMapper.insertSelective(zc);
return resumeResultResponse;
}
......
......@@ -318,11 +318,4 @@
where id = #{id,jdbcType=INTEGER}
</update>
<!--auto generated by MybatisCodeHelper on 2019-12-16-->
<select id="selectOneByResumeLink" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from zc_resume
where resume_link=#{resumeLink,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.takedata.resume.dao.ZcSynchronizeMapper">
<resultMap id="BaseResultMap" type="com.takedata.resume.model.ZcSynchronize">
<!--@mbg.generated-->
<!--@Table zc_synchronize-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="resume_id" jdbcType="INTEGER" property="resumeId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="phone" jdbcType="CHAR" property="phone" />
<result column="raw_text" jdbcType="LONGVARCHAR" property="rawText" />
<result column="expect_job" jdbcType="VARCHAR" property="expectJob" />
<result column="label" jdbcType="VARCHAR" property="label" />
<result column="create_by" jdbcType="BIGINT" property="createBy" />
<result column="interviewer_name" jdbcType="VARCHAR" property="interviewerName" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="resume_link" jdbcType="VARCHAR" property="resumeLink" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, resume_id, `name`, phone, raw_text, expect_job, `label`, create_by, interviewer_name,
`status`, resume_link
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.takedata.resume.model.ZcSynchronize" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into zc_synchronize
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="resumeId != null">
resume_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="phone != null">
phone,
</if>
<if test="rawText != null">
raw_text,
</if>
<if test="expectJob != null">
expect_job,
</if>
<if test="label != null">
`label`,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="interviewerName != null">
interviewer_name,
</if>
<if test="status != null">
`status`,
</if>
<if test="resumeLink != null">
resume_link,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="resumeId != null">
#{resumeId,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=CHAR},
</if>
<if test="rawText != null">
#{rawText,jdbcType=LONGVARCHAR},
</if>
<if test="expectJob != null">
#{expectJob,jdbcType=VARCHAR},
</if>
<if test="label != null">
#{label,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=BIGINT},
</if>
<if test="interviewerName != null">
#{interviewerName,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="resumeLink != null">
#{resumeLink,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
......@@ -318,11 +318,4 @@
where id = #{id,jdbcType=INTEGER}
</update>
<!--auto generated by MybatisCodeHelper on 2019-12-16-->
<select id="selectOneByResumeLink" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from zc_resume
where resume_link=#{resumeLink,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
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