简历功能(部分)

包括简历的添加和查看
master
liuqinghang 5 years ago
parent 5a18184cd7
commit 20de711dc6

@ -0,0 +1,112 @@
package com.hpjpw.ido.controller;
import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.hpjpw.ido.domain.Resume;
import com.hpjpw.ido.service.IResumeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author hpj
* @date 2021-04-11
*/
//@Api(value ="ResumeController")
@RestController
@RequestMapping("/ido/resume")
public class ResumeController extends BaseController
{
@Autowired
private IResumeService resumeService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('ido:resume:list')")
@GetMapping("/list")
// @ApiOperation("查询简历列表")
public TableDataInfo list(Resume resume)
{
startPage();
List<Resume> list = resumeService.selectResumeList(resume);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('ido:resume:export')")
@Log(title = "简历", businessType = BusinessType.EXPORT)
@GetMapping("/export")
// @ApiOperation("导出简历列表")
public AjaxResult export(Resume resume)
{
List<Resume> list = resumeService.selectResumeList(resume);
ExcelUtil<Resume> util = new ExcelUtil<Resume>(Resume.class);
return util.exportExcel(list, "resume");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('ido:resume:query')")
@GetMapping(value = "/{id}")
// @ApiOperation("获取简历详细信息")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(resumeService.selectResumeById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('ido:resume:add')")
@Log(title = "简历", businessType = BusinessType.INSERT)
@PostMapping
// @ApiOperation("新增简历")
public AjaxResult add(@RequestBody Resume resume)
{
return toAjax(resumeService.insertResume(resume));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('ido:resume:edit')")
@Log(title = "简历", businessType = BusinessType.UPDATE)
@PutMapping
// @ApiOperation("修改简历")
public AjaxResult edit(@RequestBody Resume resume)
{
return toAjax(resumeService.updateResume(resume));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('ido:resume:remove')")
@Log(title = "简历", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
// @ApiOperation("删除简历")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(resumeService.deleteResumeByIds(ids));
}
}

@ -0,0 +1,191 @@
package com.hpjpw.ido.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* ido_resume
*
* @author hpj
* @date 2021-04-11
*/
@ApiModel("ResumeDomain")
public class Resume extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 简历编号 */
@ApiModelProperty("${comment}")
private Long id;
/** 用户id */
@Excel(name = "用户id")
@ApiModelProperty("用户id")
private Long uId;
/** 姓名 */
@Excel(name = "姓名")
@ApiModelProperty("姓名")
private String name;
/** 证件照 */
@Excel(name = "证件照")
@ApiModelProperty("证件照")
private String selfPicture;
/** 手机号 */
@Excel(name = "手机号")
@ApiModelProperty("手机号")
private String phone;
/** 邮箱 */
@Excel(name = "邮箱")
@ApiModelProperty("邮箱")
private String email;
/** 求职意向 */
@Excel(name = "求职意向")
@ApiModelProperty("求职意向")
private String purpose;
/** 自我介绍 */
@Excel(name = "自我介绍")
@ApiModelProperty("自我介绍")
private String selfIntroduction;
/** 证书/荣誉 */
@Excel(name = "证书/荣誉")
@ApiModelProperty("证书/荣誉")
private String honor;
/** 工作/项目经历 */
@Excel(name = "工作/项目经历")
@ApiModelProperty("工作/项目经历")
private String experience;
/** 上传的简历 */
@Excel(name = "上传的简历")
@ApiModelProperty("上传的简历")
private String resumePath;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setuId(Long uId)
{
this.uId = uId;
}
public Long getuId()
{
return uId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setSelfPicture(String selfPicture)
{
this.selfPicture = selfPicture;
}
public String getSelfPicture()
{
return selfPicture;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setEmail(String email)
{
this.email = email;
}
public String getEmail()
{
return email;
}
public void setPurpose(String purpose)
{
this.purpose = purpose;
}
public String getPurpose()
{
return purpose;
}
public void setSelfIntroduction(String selfIntroduction)
{
this.selfIntroduction = selfIntroduction;
}
public String getSelfIntroduction()
{
return selfIntroduction;
}
public void setHonor(String honor)
{
this.honor = honor;
}
public String getHonor()
{
return honor;
}
public void setExperience(String experience)
{
this.experience = experience;
}
public String getExperience()
{
return experience;
}
public void setResumePath(String resumePath)
{
this.resumePath = resumePath;
}
public String getResumePath()
{
return resumePath;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("uId", getuId())
.append("name", getName())
.append("selfPicture", getSelfPicture())
.append("phone", getPhone())
.append("email", getEmail())
.append("purpose", getPurpose())
.append("selfIntroduction", getSelfIntroduction())
.append("honor", getHonor())
.append("experience", getExperience())
.append("resumePath", getResumePath())
.toString();
}
}

@ -0,0 +1,61 @@
package com.hpjpw.ido.mapper;
import java.util.List;
import com.hpjpw.ido.domain.Resume;
/**
* Mapper
*
* @author hpj
* @date 2021-04-11
*/
public interface ResumeMapper
{
/**
*
*
* @param id ID
* @return
*/
public Resume selectResumeById(Long id);
/**
*
*
* @param resume
* @return
*/
public List<Resume> selectResumeList(Resume resume);
/**
*
*
* @param resume
* @return
*/
public int insertResume(Resume resume);
/**
*
*
* @param resume
* @return
*/
public int updateResume(Resume resume);
/**
*
*
* @param id ID
* @return
*/
public int deleteResumeById(Long id);
/**
*
*
* @param ids ID
* @return
*/
public int deleteResumeByIds(Long[] ids);
}

@ -0,0 +1,61 @@
package com.hpjpw.ido.service;
import java.util.List;
import com.hpjpw.ido.domain.Resume;
/**
* Service
*
* @author hpj
* @date 2021-04-11
*/
public interface IResumeService
{
/**
*
*
* @param id ID
* @return
*/
public Resume selectResumeById(Long id);
/**
*
*
* @param resume
* @return
*/
public List<Resume> selectResumeList(Resume resume);
/**
*
*
* @param resume
* @return
*/
public int insertResume(Resume resume);
/**
*
*
* @param resume
* @return
*/
public int updateResume(Resume resume);
/**
*
*
* @param ids ID
* @return
*/
public int deleteResumeByIds(Long[] ids);
/**
*
*
* @param id ID
* @return
*/
public int deleteResumeById(Long id);
}

@ -0,0 +1,93 @@
package com.hpjpw.ido.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hpjpw.ido.mapper.ResumeMapper;
import com.hpjpw.ido.domain.Resume;
import com.hpjpw.ido.service.IResumeService;
/**
* Service
*
* @author hpj
* @date 2021-04-11
*/
@Service
public class ResumeServiceImpl implements IResumeService
{
@Autowired
private ResumeMapper resumeMapper;
/**
*
*
* @param id ID
* @return
*/
@Override
public Resume selectResumeById(Long id)
{
return resumeMapper.selectResumeById(id);
}
/**
*
*
* @param resume
* @return
*/
@Override
public List<Resume> selectResumeList(Resume resume)
{
return resumeMapper.selectResumeList(resume);
}
/**
*
*
* @param resume
* @return
*/
@Override
public int insertResume(Resume resume)
{
return resumeMapper.insertResume(resume);
}
/**
*
*
* @param resume
* @return
*/
@Override
public int updateResume(Resume resume)
{
return resumeMapper.updateResume(resume);
}
/**
*
*
* @param ids ID
* @return
*/
@Override
public int deleteResumeByIds(Long[] ids)
{
return resumeMapper.deleteResumeByIds(ids);
}
/**
*
*
* @param id ID
* @return
*/
@Override
public int deleteResumeById(Long id)
{
return resumeMapper.deleteResumeById(id);
}
}

@ -0,0 +1,124 @@
package com.hpjpw.idoapp.controller;
import com.hpjpw.ido.domain.Resume;
import com.hpjpw.ido.service.IResumeService;
import com.hpjpw.idoapp.service.IDoResumeService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysUserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @author
* @Data
*/
@RestController
@RequestMapping("/ido/app/resume")
public class IDoResumeController extends BaseController {
@Autowired
IResumeService idoResumeService;
@Autowired
IDoResumeService idoAppResumeService;
@Autowired
ISysUserService sysUserService;
/**
*
*/
@PostMapping("updateResume")
@ApiOperation("更新简历内容,参数为- 简历编号\n" +
"- 用户id\n" +
"- 证件照\n" +
"- 姓名\n" +
"- 联系方式\n" +
"- 邮箱\n" +
"- 求职意向\n" +
"- 自我介绍\n" +
"- 证书/荣誉(仿就业平台)\n" +
"- 工作/项目经历(仿就业平台)\n" +
"- 上传简历路径")
public AjaxResult updateResume(@RequestBody Resume resume){
/* 安全校验1无该发布者*/
if (StringUtils.isNull(sysUserService.selectUserById(resume.getuId()))){
return AjaxResult.error("错误没有此发布者请检查Uid");
}
/* 安全校验2无此简历 */
if (StringUtils.isNull(idoResumeService.selectResumeById(resume.getId()))){
return AjaxResult.error("错误!无此简历,请新建一个简历");
}
Resume newResume = new Resume();
newResume.setId(resume.getId());
newResume.setuId(resume.getuId());
newResume.setName(resume.getName());
newResume.setSelfPicture(resume.getSelfPicture());
newResume.setEmail(resume.getEmail());
newResume.setPhone(resume.getPhone());
newResume.setSelfIntroduction(resume.getSelfIntroduction());
newResume.setPurpose(resume.getPurpose());
newResume.setHonor(resume.getHonor());
newResume.setExperience(resume.getExperience());
newResume.setResumePath(resume.getResumePath());
idoResumeService.updateResume(newResume);
return AjaxResult.success();
}
/**
*
*/
@PostMapping("addResume")
@ApiOperation("添加新简历,参数为 - 用户id\n" +
"- 证件照\n" +
"- 姓名\n" +
"- 联系方式\n" +
"- 邮箱\n" +
"- 求职意向\n" +
"- 自我介绍\n" +
"- 证书/荣誉(仿就业平台)\n" +
"- 工作/项目经历(仿就业平台)\n" +
"- 上传简历路径")
public AjaxResult addResume(@RequestBody Resume resume){
/* 安全校验1无该发布者*/
if (StringUtils.isNull(sysUserService.selectUserById(resume.getuId()))){
return AjaxResult.error("错误没有此发布者请检查Uid");
}
Resume resumeadd = new Resume();
resumeadd.setuId(resume.getuId());
resumeadd.setName(resume.getName());
resumeadd.setSelfPicture(resume.getSelfPicture());
resumeadd.setEmail(resume.getEmail());
resumeadd.setPhone(resume.getPhone());
resumeadd.setSelfIntroduction(resume.getSelfIntroduction());
resumeadd.setPurpose(resume.getPurpose());
resumeadd.setHonor(resume.getHonor());
resumeadd.setExperience(resume.getExperience());
resumeadd.setResumePath(resume.getResumePath());
idoResumeService.insertResume(resumeadd);
return AjaxResult.success();
}
/**
*
*/
@ApiOperation("查询用户的简历列表,接收参数 用户id")
@GetMapping("/list/{u_id}")
public TableDataInfo query(@PathVariable("u_id") long u_id){
List<Map<String, String>> mapList = idoAppResumeService.personnalResume(u_id);
return getDataTable(mapList);
}
}

@ -0,0 +1,42 @@
package com.hpjpw.idoapp.service;
import com.hpjpw.ido.domain.Resume;
import com.hpjpw.ido.service.IResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class IDoResumeService {
@Autowired
IResumeService ResumeService;
public List<Map<String,String>> personnalResume(Long u_Id){
/* 实际返回的列表 */
List<Map<String, String>> listReturn = new ArrayList<>();
/*获取简历列表*/
Resume resume = new Resume();
resume.setuId(u_Id);
List<Resume> resumeList = ResumeService.selectResumeList(resume);
for(Resume item : resumeList){
Map<String,String> map = new HashMap<>();
map.put("resumeId",item.getId().toString());
map.put("userId",item.getuId().toString());
map.put("name",item.getName().toString());
map.put("selfPicture",item.getSelfPicture().toString());
map.put("phone",item.getPhone().toString());
map.put("email",item.getEmail().toString());
map.put("purpose",item.getPurpose().toString());
map.put("selfIntroduction",item.getSelfIntroduction().toString());
map.put("honor",item.getHonor().toString());
map.put("experience",item.getExperience().toString());
map.put("resumePath",item.getResumePath().toString());
listReturn.add(map);
}
return listReturn;
}
}

@ -0,0 +1,101 @@
<?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.hpjpw.ido.mapper.ResumeMapper">
<resultMap type="Resume" id="ResumeResult">
<result property="id" column="id" />
<result property="uId" column="u_id" />
<result property="name" column="name" />
<result property="selfPicture" column="self_picture" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="purpose" column="purpose" />
<result property="selfIntroduction" column="self_introduction" />
<result property="honor" column="honor" />
<result property="experience" column="experience" />
<result property="resumePath" column="resume_path" />
</resultMap>
<sql id="selectResumeVo">
select `id`, `u_id`, `name`, `self_picture`, `phone`, `email`, `purpose`, `self_introduction`, `honor`, `experience`, `resume_path` from ido_resume
</sql>
<select id="selectResumeList" parameterType="Resume" resultMap="ResumeResult">
<include refid="selectResumeVo"/>
<where>
<if test="uId != null "> and `u_id` = #{uId}</if>
<if test="name != null and name != ''"> and `name` like concat('%', #{name}, '%')</if>
<if test="selfPicture != null and selfPicture != ''"> and `self_picture` = #{selfPicture}</if>
<if test="phone != null and phone != ''"> and `phone` = #{phone}</if>
<if test="email != null and email != ''"> and `email` = #{email}</if>
<if test="purpose != null and purpose != ''"> and `purpose` = #{purpose}</if>
<if test="selfIntroduction != null and selfIntroduction != ''"> and `self_introduction` = #{selfIntroduction}</if>
<if test="honor != null and honor != ''"> and `honor` = #{honor}</if>
<if test="experience != null and experience != ''"> and `experience` = #{experience}</if>
<if test="resumePath != null and resumePath != ''"> and `resume_path` = #{resumePath}</if>
</where>
</select>
<select id="selectResumeById" parameterType="String" resultMap="ResumeResult">
<include refid="selectResumeVo"/>
where `id` = #{id}
</select>
<insert id="insertResume" parameterType="Resume" useGeneratedKeys="true" keyProperty="id">
insert into ido_resume
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uId != null">`u_id`,</if>
<if test="name != null and name != ''">`name`,</if>
<if test="selfPicture != null and selfPicture != ''">`self_picture`,</if>
<if test="phone != null and phone != ''">`phone`,</if>
<if test="email != null and email != ''">`email`,</if>
<if test="purpose != null and purpose != ''">`purpose`,</if>
<if test="selfIntroduction != null and selfIntroduction != ''">`self_introduction`,</if>
<if test="honor != null and honor != ''">`honor`,</if>
<if test="experience != null and experience != ''">`experience`,</if>
<if test="resumePath != null and resumePath != ''">`resume_path`,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uId != null">#{uId},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="selfPicture != null and selfPicture != ''">#{selfPicture},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="purpose != null and purpose != ''">#{purpose},</if>
<if test="selfIntroduction != null and selfIntroduction != ''">#{selfIntroduction},</if>
<if test="honor != null and honor != ''">#{honor},</if>
<if test="experience != null and experience != ''">#{experience},</if>
<if test="resumePath != null and resumePath != ''">#{resumePath},</if>
</trim>
</insert>
<update id="updateResume" parameterType="Resume">
update ido_resume
<trim prefix="SET" suffixOverrides=",">
<if test="uId != null">`u_id` = #{uId},</if>
<if test="name != null and name != ''">`name` = #{name},</if>
<if test="selfPicture != null and selfPicture != ''">`self_picture` = #{selfPicture},</if>
<if test="phone != null and phone != ''">`phone` = #{phone},</if>
<if test="email != null and email != ''">`email` = #{email},</if>
<if test="purpose != null and purpose != ''">`purpose` = #{purpose},</if>
<if test="selfIntroduction != null and selfIntroduction != ''">`self_introduction` = #{selfIntroduction},</if>
<if test="honor != null and honor != ''">`honor` = #{honor},</if>
<if test="experience != null and experience != ''">`experience` = #{experience},</if>
<if test="resumePath != null and resumePath != ''">`resume_path` = #{resumePath},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteResumeById" parameterType="String">
delete from ido_resume where id = #{id}
</delete>
<delete id="deleteResumeByIds" parameterType="String">
delete from ido_resume where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save