官网 招聘信息表基础代码提交
This commit is contained in:
parent
4371241b16
commit
3dbf4a9fa6
|
@ -14,6 +14,8 @@ import com.ruoyi.system.domain.bo.SysOssBo;
|
|||
import com.ruoyi.system.domain.vo.SysOssVo;
|
||||
import com.ruoyi.system.service.ISysOssService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -21,6 +23,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
@ -35,9 +38,13 @@ import java.util.Map;
|
|||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/system/oss")
|
||||
public class SysOssController extends BaseController {
|
||||
|
||||
@Value("${file.BASE_FILE_SAVE_PATH}")
|
||||
private String filePath;
|
||||
|
||||
private final ISysOssService iSysOssService;
|
||||
|
||||
/**
|
||||
|
@ -82,6 +89,43 @@ public class SysOssController extends BaseController {
|
|||
return R.ok(map);
|
||||
}
|
||||
|
||||
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addPartsUpload")
|
||||
public R<Map<String, String>> addPartsUpload(@RequestPart("file") MultipartFile file) {
|
||||
Map<String,String> map=new HashMap<>();
|
||||
log.info("上传的文件名称:{}",file.getOriginalFilename());
|
||||
//文件上传的地址从配置文件中获取
|
||||
log.info("上传的文件地址:{}",filePath);
|
||||
try {
|
||||
if (file.isEmpty()) {
|
||||
return R.fail("上传文件不能为空");
|
||||
}
|
||||
|
||||
String fileName = System.currentTimeMillis()+"-"+file.getOriginalFilename();
|
||||
//文件上传的路径(当前项目的根目录)
|
||||
|
||||
System.err.println(filePath);
|
||||
// 创建目标目录(如果不存在)
|
||||
File directory = new File(filePath);
|
||||
if (!directory.exists()) {
|
||||
directory.mkdirs();
|
||||
}
|
||||
// 保存文件到目标目录
|
||||
File uploadFile = new File(directory.getAbsolutePath() + File.separator + fileName);
|
||||
file.transferTo(uploadFile);
|
||||
String pathFan=filePath.replace("\\","/");
|
||||
//filePath获取到的地址斜杠是“ \ ”的(单斜杠是特殊符号,得用双斜杠代替),得换成“ / ”才能访问到
|
||||
|
||||
map.put("fileName",pathFan+fileName);
|
||||
log.info("替换后的文件名称:{}",pathFan+fileName);
|
||||
//修改数据库
|
||||
return R.ok(map);
|
||||
} catch (IOException e) {
|
||||
return R.fail("文件上传失败: "+e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载OSS对象
|
||||
*
|
||||
|
|
|
@ -0,0 +1,114 @@
|
|||
package com.ruoyi.official.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.official.domain.vo.GwJobInfoVo;
|
||||
import com.ruoyi.official.domain.bo.GwJobInfoBo;
|
||||
import com.ruoyi.official.service.IGwJobInfoService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 招聘信息
|
||||
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/official/jobInfo")
|
||||
public class GwJobInfoController extends BaseController {
|
||||
|
||||
private final IGwJobInfoService iGwJobInfoService;
|
||||
|
||||
/**
|
||||
* 查询招聘信息
|
||||
列表
|
||||
*/
|
||||
@SaCheckPermission("official:jobInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GwJobInfoVo> list(GwJobInfoBo bo, PageQuery pageQuery) {
|
||||
return iGwJobInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出招聘信息
|
||||
列表
|
||||
*/
|
||||
@SaCheckPermission("official:jobInfo:export")
|
||||
@Log(title = "招聘信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(GwJobInfoBo bo, HttpServletResponse response) {
|
||||
List<GwJobInfoVo> list = iGwJobInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "招聘信息", GwJobInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取招聘信息
|
||||
详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("official:jobInfo:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<GwJobInfoVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(iGwJobInfoService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增招聘信息
|
||||
|
||||
*/
|
||||
@SaCheckPermission("official:jobInfo:add")
|
||||
@Log(title = "招聘信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody GwJobInfoBo bo) {
|
||||
return toAjax(iGwJobInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改招聘信息
|
||||
|
||||
*/
|
||||
@SaCheckPermission("official:jobInfo:edit")
|
||||
@Log(title = "招聘信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GwJobInfoBo bo) {
|
||||
return toAjax(iGwJobInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除招聘信息
|
||||
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("official:jobInfo:remove")
|
||||
@Log(title = "招聘信息 ", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iGwJobInfoService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.ruoyi.official.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 招聘信息
|
||||
对象 gw_job_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("gw_job_info")
|
||||
public class GwJobInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 标签id
|
||||
*/
|
||||
private Long lableId;
|
||||
/**
|
||||
* 招聘岗位
|
||||
*/
|
||||
private String jobPost;
|
||||
/**
|
||||
* 岗位类型
|
||||
*/
|
||||
private String postType;
|
||||
/**
|
||||
* 招聘类型
|
||||
*/
|
||||
private String jobType;
|
||||
/**
|
||||
* 工作地点
|
||||
*/
|
||||
private String baseSite;
|
||||
/**
|
||||
* 工作职责
|
||||
*/
|
||||
private String jobDuties;
|
||||
/**
|
||||
* 任职资格
|
||||
*/
|
||||
private String qualification;
|
||||
/**
|
||||
* 创建者id
|
||||
*/
|
||||
private Long createUserId;
|
||||
/**
|
||||
* 更新者id
|
||||
*/
|
||||
private Long updateUserId;
|
||||
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package com.ruoyi.official.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 招聘信息
|
||||
业务对象 gw_job_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GwJobInfoBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标签id
|
||||
*/
|
||||
@NotNull(message = "标签id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long lableId;
|
||||
|
||||
/**
|
||||
* 招聘岗位
|
||||
*/
|
||||
@NotBlank(message = "招聘岗位不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String jobPost;
|
||||
|
||||
/**
|
||||
* 岗位类型
|
||||
*/
|
||||
@NotBlank(message = "岗位类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String postType;
|
||||
|
||||
/**
|
||||
* 招聘类型
|
||||
*/
|
||||
@NotBlank(message = "招聘类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String jobType;
|
||||
|
||||
/**
|
||||
* 工作地点
|
||||
*/
|
||||
@NotBlank(message = "工作地点不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String baseSite;
|
||||
|
||||
/**
|
||||
* 工作职责
|
||||
*/
|
||||
@NotBlank(message = "工作职责不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String jobDuties;
|
||||
|
||||
/**
|
||||
* 任职资格
|
||||
*/
|
||||
@NotBlank(message = "任职资格不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String qualification;
|
||||
|
||||
/**
|
||||
* 创建者id
|
||||
*/
|
||||
@NotNull(message = "创建者id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 更新者id
|
||||
*/
|
||||
@NotNull(message = "更新者id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long updateUserId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package com.ruoyi.official.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 招聘信息
|
||||
视图对象 gw_job_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class GwJobInfoVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标签id
|
||||
*/
|
||||
@ExcelProperty(value = "标签id")
|
||||
private Long lableId;
|
||||
|
||||
/**
|
||||
* 招聘岗位
|
||||
*/
|
||||
@ExcelProperty(value = "招聘岗位")
|
||||
private String jobPost;
|
||||
|
||||
/**
|
||||
* 岗位类型
|
||||
*/
|
||||
@ExcelProperty(value = "岗位类型")
|
||||
private String postType;
|
||||
|
||||
/**
|
||||
* 招聘类型
|
||||
*/
|
||||
@ExcelProperty(value = "招聘类型")
|
||||
private String jobType;
|
||||
|
||||
/**
|
||||
* 工作地点
|
||||
*/
|
||||
@ExcelProperty(value = "工作地点")
|
||||
private String baseSite;
|
||||
|
||||
/**
|
||||
* 工作职责
|
||||
*/
|
||||
@ExcelProperty(value = "工作职责")
|
||||
private String jobDuties;
|
||||
|
||||
/**
|
||||
* 任职资格
|
||||
*/
|
||||
@ExcelProperty(value = "任职资格")
|
||||
private String qualification;
|
||||
|
||||
/**
|
||||
* 创建者id
|
||||
*/
|
||||
@ExcelProperty(value = "创建者id")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 更新者id
|
||||
*/
|
||||
@ExcelProperty(value = "更新者id")
|
||||
private Long updateUserId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.ruoyi.official.mapper;
|
||||
|
||||
import com.ruoyi.official.domain.GwJobInfo;
|
||||
import com.ruoyi.official.domain.vo.GwJobInfoVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 招聘信息
|
||||
Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface GwJobInfoMapper extends BaseMapperPlus<GwJobInfoMapper, GwJobInfo, GwJobInfoVo> {
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.ruoyi.official.service;
|
||||
|
||||
|
||||
import com.ruoyi.official.domain.vo.GwJobInfoVo;
|
||||
import com.ruoyi.official.domain.bo.GwJobInfoBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘信息
|
||||
Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface IGwJobInfoService {
|
||||
|
||||
/**
|
||||
* 查询招聘信息
|
||||
|
||||
*/
|
||||
GwJobInfoVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询招聘信息列表
|
||||
*/
|
||||
TableDataInfo<GwJobInfoVo> queryPageList(GwJobInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询招聘信息
|
||||
列表
|
||||
*/
|
||||
List<GwJobInfoVo> queryList(GwJobInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增招聘信息
|
||||
|
||||
*/
|
||||
Boolean insertByBo(GwJobInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改招聘信息
|
||||
|
||||
*/
|
||||
Boolean updateByBo(GwJobInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除招聘信息信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package com.ruoyi.official.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.official.domain.bo.GwJobInfoBo;
|
||||
import com.ruoyi.official.domain.vo.GwJobInfoVo;
|
||||
import com.ruoyi.official.domain.GwJobInfo;
|
||||
import com.ruoyi.official.mapper.GwJobInfoMapper;
|
||||
import com.ruoyi.official.service.IGwJobInfoService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 招聘信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
||||
|
||||
private final GwJobInfoMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询招聘信息
|
||||
*/
|
||||
@Override
|
||||
public GwJobInfoVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招聘信息列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<GwJobInfoVo> queryPageList(GwJobInfoBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<GwJobInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<GwJobInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招聘信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<GwJobInfoVo> queryList(GwJobInfoBo bo) {
|
||||
LambdaQueryWrapper<GwJobInfo> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<GwJobInfo> buildQueryWrapper(GwJobInfoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<GwJobInfo> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getLableId() != null, GwJobInfo::getLableId, bo.getLableId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getJobPost()), GwJobInfo::getJobPost, bo.getJobPost());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPostType()), GwJobInfo::getPostType, bo.getPostType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getJobType()), GwJobInfo::getJobType, bo.getJobType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBaseSite()), GwJobInfo::getBaseSite, bo.getBaseSite());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getJobDuties()), GwJobInfo::getJobDuties, bo.getJobDuties());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getQualification()), GwJobInfo::getQualification, bo.getQualification());
|
||||
lqw.eq(bo.getCreateUserId() != null, GwJobInfo::getCreateUserId, bo.getCreateUserId());
|
||||
lqw.eq(bo.getUpdateUserId() != null, GwJobInfo::getUpdateUserId, bo.getUpdateUserId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增招聘信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(GwJobInfoBo bo) {
|
||||
GwJobInfo add = BeanUtil.toBean(bo, GwJobInfo.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改招聘信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(GwJobInfoBo bo) {
|
||||
GwJobInfo update = BeanUtil.toBean(bo, GwJobInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(GwJobInfo entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除招聘信息
|
||||
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?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.ruoyi.official.mapper.GwJobInfoMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.official.domain.GwJobInfo" id="GwJobInfoResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="lableId" column="lable_id"/>
|
||||
<result property="jobPost" column="job_post"/>
|
||||
<result property="postType" column="post_type"/>
|
||||
<result property="jobType" column="job_type"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="baseSite" column="base_site"/>
|
||||
<result property="jobDuties" column="job_duties"/>
|
||||
<result property="qualification" column="qualification"/>
|
||||
<result property="createUserId" column="create_user_id"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateUserId" column="update_user_id"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
49
ruoyi-ui/src/api/official/jobInfo.js
Normal file
49
ruoyi-ui/src/api/official/jobInfo.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询招聘信息
|
||||
列表
|
||||
export function listJobInfo(query) {
|
||||
return request({
|
||||
url: '/official/jobInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询招聘信息
|
||||
详细
|
||||
export function getJobInfo(id) {
|
||||
return request({
|
||||
url: '/official/jobInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增招聘信息
|
||||
|
||||
export function addJobInfo(data) {
|
||||
return request({
|
||||
url: '/official/jobInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改招聘信息
|
||||
|
||||
export function updateJobInfo(data) {
|
||||
return request({
|
||||
url: '/official/jobInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除招聘信息
|
||||
|
||||
export function delJobInfo(id) {
|
||||
return request({
|
||||
url: '/official/jobInfo/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
384
ruoyi-ui/src/views/official/jobInfo/index.vue
Normal file
384
ruoyi-ui/src/views/official/jobInfo/index.vue
Normal file
|
@ -0,0 +1,384 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="标签id" prop="lableId">
|
||||
<el-input
|
||||
v-model="queryParams.lableId"
|
||||
placeholder="请输入标签id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="招聘岗位" prop="jobPost">
|
||||
<el-input
|
||||
v-model="queryParams.jobPost"
|
||||
placeholder="请输入招聘岗位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工作地点" prop="baseSite">
|
||||
<el-input
|
||||
v-model="queryParams.baseSite"
|
||||
placeholder="请输入工作地点"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工作职责" prop="jobDuties">
|
||||
<el-input
|
||||
v-model="queryParams.jobDuties"
|
||||
placeholder="请输入工作职责"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任职资格" prop="qualification">
|
||||
<el-input
|
||||
v-model="queryParams.qualification"
|
||||
placeholder="请输入任职资格"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建者id" prop="createUserId">
|
||||
<el-input
|
||||
v-model="queryParams.createUserId"
|
||||
placeholder="请输入创建者id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新者id" prop="updateUserId">
|
||||
<el-input
|
||||
v-model="queryParams.updateUserId"
|
||||
placeholder="请输入更新者id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['official:jobInfo:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['official:jobInfo:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['official:jobInfo:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['official:jobInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="jobInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键id" align="center" prop="id" v-if="true"/>
|
||||
<el-table-column label="标签id" align="center" prop="lableId" />
|
||||
<el-table-column label="招聘岗位" align="center" prop="jobPost" />
|
||||
<el-table-column label="岗位类型" align="center" prop="postType" />
|
||||
<el-table-column label="招聘类型" align="center" prop="jobType" />
|
||||
<el-table-column label="工作地点" align="center" prop="baseSite" />
|
||||
<el-table-column label="工作职责" align="center" prop="jobDuties" />
|
||||
<el-table-column label="任职资格" align="center" prop="qualification" />
|
||||
<el-table-column label="创建者id" align="center" prop="createUserId" />
|
||||
<el-table-column label="更新者id" align="center" prop="updateUserId" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['official:jobInfo:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['official:jobInfo:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改招聘信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="标签id" prop="lableId">
|
||||
<el-input v-model="form.lableId" placeholder="请输入标签id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="招聘岗位" prop="jobPost">
|
||||
<el-input v-model="form.jobPost" placeholder="请输入招聘岗位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工作地点" prop="baseSite">
|
||||
<el-input v-model="form.baseSite" placeholder="请输入工作地点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工作职责" prop="jobDuties">
|
||||
<el-input v-model="form.jobDuties" placeholder="请输入工作职责" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任职资格" prop="qualification">
|
||||
<el-input v-model="form.qualification" placeholder="请输入任职资格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建者id" prop="createUserId">
|
||||
<el-input v-model="form.createUserId" placeholder="请输入创建者id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新者id" prop="updateUserId">
|
||||
<el-input v-model="form.updateUserId" placeholder="请输入更新者id" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listJobInfo, getJobInfo, delJobInfo, addJobInfo, updateJobInfo } from "@/api/official/jobInfo";
|
||||
|
||||
export default {
|
||||
name: "JobInfo",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 招聘信息表格数据
|
||||
jobInfoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
lableId: undefined,
|
||||
jobPost: undefined,
|
||||
postType: undefined,
|
||||
jobType: undefined,
|
||||
baseSite: undefined,
|
||||
jobDuties: undefined,
|
||||
qualification: undefined,
|
||||
createUserId: undefined,
|
||||
updateUserId: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "主键id不能为空", trigger: "blur" }
|
||||
],
|
||||
lableId: [
|
||||
{ required: true, message: "标签id不能为空", trigger: "blur" }
|
||||
],
|
||||
jobPost: [
|
||||
{ required: true, message: "招聘岗位不能为空", trigger: "blur" }
|
||||
],
|
||||
postType: [
|
||||
{ required: true, message: "岗位类型不能为空", trigger: "change" }
|
||||
],
|
||||
jobType: [
|
||||
{ required: true, message: "招聘类型不能为空", trigger: "change" }
|
||||
],
|
||||
baseSite: [
|
||||
{ required: true, message: "工作地点不能为空", trigger: "blur" }
|
||||
],
|
||||
jobDuties: [
|
||||
{ required: true, message: "工作职责不能为空", trigger: "blur" }
|
||||
],
|
||||
qualification: [
|
||||
{ required: true, message: "任职资格不能为空", trigger: "blur" }
|
||||
],
|
||||
createUserId: [
|
||||
{ required: true, message: "创建者id不能为空", trigger: "blur" }
|
||||
],
|
||||
updateUserId: [
|
||||
{ required: true, message: "更新者id不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询招聘信息
|
||||
列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listJobInfo(this.queryParams).then(response => {
|
||||
this.jobInfoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
lableId: undefined,
|
||||
jobPost: undefined,
|
||||
postType: undefined,
|
||||
jobType: undefined,
|
||||
createBy: undefined,
|
||||
baseSite: undefined,
|
||||
jobDuties: undefined,
|
||||
qualification: undefined,
|
||||
createUserId: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateUserId: undefined,
|
||||
updateTime: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加招聘信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getJobInfo(id).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改招聘信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.id != null) {
|
||||
updateJobInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addJobInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除招聘信息编号为"' + ids + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delJobInfo(ids);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('official/jobInfo/export', {
|
||||
...this.queryParams
|
||||
}, `jobInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user