Compare commits
No commits in common. "3dc9354556793af1aab64e61bea296f67bb94e99" and "d69c862e66276f56cbb6ac1ae6766d7f9be04f72" have entirely different histories.
3dc9354556
...
d69c862e66
|
@ -22,13 +22,14 @@ import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.util.Arrays;
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件上传 控制层
|
* 文件上传 控制层
|
||||||
|
@ -44,7 +45,6 @@ public class SysOssController extends BaseController {
|
||||||
|
|
||||||
@Value("${file.BASE_FILE_SAVE_PATH}")
|
@Value("${file.BASE_FILE_SAVE_PATH}")
|
||||||
private String uploadPath;
|
private String uploadPath;
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
|
|
||||||
|
|
||||||
private final ISysOssService iSysOssService;
|
private final ISysOssService iSysOssService;
|
||||||
private final ISysImageService iSysImageService;
|
private final ISysImageService iSysImageService;
|
||||||
|
@ -98,30 +98,43 @@ public class SysOssController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@Log(title = "本地文件上传", businessType = BusinessType.INSERT)
|
@Log(title = "本地文件上传", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/addPartsUpload")
|
@PostMapping("/addPartsUpload")
|
||||||
public R<Map<String, String>> addPartsUpload(@RequestPart("file") MultipartFile file, HttpServletRequest req) {
|
public R<Map<String, String>> addPartsUpload(@RequestPart("file") MultipartFile file) {
|
||||||
Map<String,String> map=new HashMap<>();
|
Map<String,String> map=new HashMap<>();
|
||||||
String realPath = req.getSession().getServletContext().getRealPath("/uploadFile/");
|
|
||||||
String format = sdf.format(new Date());
|
String filePath=uploadPath+"/file/upload/";
|
||||||
///www/wwwroot/guanwang/web/image/file/upload/
|
|
||||||
// String filePath=uploadPath+"/file/upload/";
|
|
||||||
File folder = new File(realPath + format);
|
|
||||||
if (!folder.isDirectory()){
|
|
||||||
folder.mkdirs();
|
|
||||||
}
|
|
||||||
String oldName = file.getOriginalFilename();
|
|
||||||
String newName = UUID.randomUUID().toString() + oldName.substring(oldName.lastIndexOf("."), oldName.length());
|
|
||||||
try {
|
try {
|
||||||
file.transferTo(new File(realPath,newName));
|
if (file.isEmpty()) {
|
||||||
String filePath = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + "/uploadFile" + format + newName;
|
return R.warn("文件为空");
|
||||||
Long image = iSysImageService.uploadImage(newName,filePath);
|
}
|
||||||
map.put("url",filePath);
|
|
||||||
map.put("fileName",newName);
|
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获取到的地址斜杠是“ \ ”的(单斜杠是特殊符号,得用双斜杠代替),得换成“ / ”才能访问到
|
||||||
|
//返回全路径图片地址
|
||||||
|
String returnPath = ("http://47.121.27.78:8008/upload/" + fileName).replace("\\","/");
|
||||||
|
//修改数据库
|
||||||
|
Long image = iSysImageService.uploadImage(fileName,returnPath);
|
||||||
|
System.err.println("替换后:"+pathFan);
|
||||||
|
map.put("url",returnPath);
|
||||||
|
map.put("fileName",fileName);
|
||||||
map.put("ossId",image.toString());
|
map.put("ossId",image.toString());
|
||||||
return R.ok(map);
|
return R.ok(map);
|
||||||
} catch (IOException ex) {
|
} catch (IOException e) {
|
||||||
ex.printStackTrace();
|
return R.warn("文件上传失败: "+e);
|
||||||
}
|
}
|
||||||
return R.warn("文件上传失败!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -132,8 +132,6 @@ security:
|
||||||
- /**/*.jpg
|
- /**/*.jpg
|
||||||
- # 配置白名单
|
- # 配置白名单
|
||||||
- /official/slideshow/**
|
- /official/slideshow/**
|
||||||
- /official/jobInfo/**
|
|
||||||
- /official/index/**
|
|
||||||
# 公共路径
|
# 公共路径
|
||||||
- /favicon.ico
|
- /favicon.ico
|
||||||
- /error
|
- /error
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class GwIndexController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 查询首页封面信息列表
|
* 查询首页封面信息列表
|
||||||
*/
|
*/
|
||||||
/* @SaCheckPermission("official:index:list")*/
|
@SaCheckPermission("official:index:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<GwIndexVo> list(GwIndexBo bo, PageQuery pageQuery) {
|
public TableDataInfo<GwIndexVo> list(GwIndexBo bo, PageQuery pageQuery) {
|
||||||
return iGwIndexService.queryPageList(bo, pageQuery);
|
return iGwIndexService.queryPageList(bo, pageQuery);
|
||||||
|
|
|
@ -41,7 +41,8 @@ public class GwJobController extends BaseController {
|
||||||
private final IGwJobService iGwJobService;
|
private final IGwJobService iGwJobService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询招聘信息列表
|
* 查询招聘信息
|
||||||
|
列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("official:job:list")
|
@SaCheckPermission("official:job:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
|
|
|
@ -41,16 +41,18 @@ public class GwJobInfoController extends BaseController {
|
||||||
private final IGwJobInfoService iGwJobInfoService;
|
private final IGwJobInfoService iGwJobInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询招聘信息列表
|
* 查询招聘信息
|
||||||
|
列表
|
||||||
*/
|
*/
|
||||||
/* @SaCheckPermission("official:jobInfo:list")*/
|
@SaCheckPermission("official:jobInfo:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<GwJobInfoVo> list(GwJobInfoBo bo, PageQuery pageQuery) {
|
public TableDataInfo<GwJobInfoVo> list(GwJobInfoBo bo, PageQuery pageQuery) {
|
||||||
return iGwJobInfoService.queryPageList(bo, pageQuery);
|
return iGwJobInfoService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出招聘信息列表
|
* 导出招聘信息
|
||||||
|
列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("official:jobInfo:export")
|
@SaCheckPermission("official:jobInfo:export")
|
||||||
@Log(title = "招聘信息", businessType = BusinessType.EXPORT)
|
@Log(title = "招聘信息", businessType = BusinessType.EXPORT)
|
||||||
|
@ -61,7 +63,8 @@ public class GwJobInfoController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取招聘信息详细信息
|
* 获取招聘信息
|
||||||
|
详细信息
|
||||||
*
|
*
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -48,16 +48,6 @@ public class GwIndex extends BaseEntity {
|
||||||
* 图片标题英文描述
|
* 图片标题英文描述
|
||||||
*/
|
*/
|
||||||
private String titleEnglish;
|
private String titleEnglish;
|
||||||
|
|
||||||
/**
|
|
||||||
* 业务名称英文描述
|
|
||||||
*/
|
|
||||||
private String businessNameEnglish;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序
|
|
||||||
*/
|
|
||||||
private String orders;
|
|
||||||
/**
|
/**
|
||||||
* 图片标题中文描述
|
* 图片标题中文描述
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -39,7 +39,8 @@ public class GwJobInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 薪资范围
|
* 薪资范围
|
||||||
*/
|
*/
|
||||||
private String salaryRange;
|
private String
|
||||||
|
salaryRange;
|
||||||
/**
|
/**
|
||||||
* 工作地点
|
* 工作地点
|
||||||
*/
|
*/
|
||||||
|
@ -52,12 +53,6 @@ public class GwJobInfo extends BaseEntity {
|
||||||
* 年龄范围
|
* 年龄范围
|
||||||
*/
|
*/
|
||||||
private String ageRange;
|
private String ageRange;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 福利
|
|
||||||
*/
|
|
||||||
private String welfare;
|
|
||||||
/**
|
/**
|
||||||
* 发布时间
|
* 发布时间
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.ruoyi.official.domain.bo;
|
package com.ruoyi.official.domain.bo;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
import com.ruoyi.common.core.validate.AddGroup;
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
import com.ruoyi.common.core.validate.EditGroup;
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -26,13 +25,13 @@ public class GwIndexBo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 主键id
|
* 主键id
|
||||||
*/
|
*/
|
||||||
|
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片上传地址
|
* 图片上传地址
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "图片上传地址不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String imageurl;
|
private String imageurl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,45 +42,33 @@ public class GwIndexBo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务
|
* 业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务 不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String businessType;
|
private String businessType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务名称
|
* 业务名称
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "业务名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String businessName;
|
private String businessName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片标题英文描述
|
* 图片标题英文描述
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "图片标题英文描述不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String titleEnglish;
|
private String titleEnglish;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片标题中文描述
|
* 图片标题中文描述
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "图片标题中文描述不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String titleChinese;
|
private String titleChinese;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否置顶 0:否 1:是
|
* 是否置顶 0:否 1:是
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "是否置顶 0:否 1:是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String isIndex;
|
private String isIndex;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 业务名称英文描述
|
|
||||||
*/
|
|
||||||
private String businessNameEnglish;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序
|
|
||||||
*/
|
|
||||||
|
|
||||||
private String orders;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标题名称
|
* 标题名称
|
||||||
*/
|
*/
|
||||||
|
@ -91,13 +78,13 @@ public class GwIndexBo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 创建者id
|
* 创建者id
|
||||||
*/
|
*/
|
||||||
|
@NotNull(message = "创建者id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long createUserId;
|
private Long createUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新者id
|
* 更新者id
|
||||||
*/
|
*/
|
||||||
|
@NotNull(message = "更新者id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long updateUserId;
|
private Long updateUserId;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.ruoyi.official.domain.bo;
|
package com.ruoyi.official.domain.bo;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.ruoyi.common.core.validate.AddGroup;
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
import com.ruoyi.common.core.validate.EditGroup;
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -10,7 +9,6 @@ import javax.validation.constraints.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 招聘信息
|
* 招聘信息
|
||||||
|
@ -27,7 +25,7 @@ public class GwJobInfoBo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 主键id
|
* 主键id
|
||||||
*/
|
*/
|
||||||
|
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,8 +68,7 @@ public class GwJobInfoBo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 发布时间
|
* 发布时间
|
||||||
*/
|
*/
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@NotNull(message = "发布时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date releaseTime;
|
private Date releaseTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,12 +77,6 @@ public class GwJobInfoBo extends BaseEntity {
|
||||||
@NotBlank(message = "是否置顶 0:否 1:是不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "是否置顶 0:否 1:是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String isTop;
|
private String isTop;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 福利
|
|
||||||
*/
|
|
||||||
private String welfare;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位职责
|
* 岗位职责
|
||||||
*/
|
*/
|
||||||
|
@ -107,11 +98,13 @@ public class GwJobInfoBo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 创建者id
|
* 创建者id
|
||||||
*/
|
*/
|
||||||
|
@NotNull(message = "创建者id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long createUserId;
|
private Long createUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新者id
|
* 更新者id
|
||||||
*/
|
*/
|
||||||
|
@NotNull(message = "更新者id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long updateUserId;
|
private Long updateUserId;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,13 +46,6 @@ public class GwIndexVo {
|
||||||
@ExcelProperty(value = "业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务 ")
|
@ExcelProperty(value = "业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务 ")
|
||||||
private String businessType;
|
private String businessType;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序
|
|
||||||
*/
|
|
||||||
|
|
||||||
private String orders;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务名称
|
* 业务名称
|
||||||
*/
|
*/
|
||||||
|
@ -71,12 +64,6 @@ public class GwIndexVo {
|
||||||
@ExcelProperty(value = "图片标题中文描述")
|
@ExcelProperty(value = "图片标题中文描述")
|
||||||
private String titleChinese;
|
private String titleChinese;
|
||||||
|
|
||||||
/**
|
|
||||||
* 业务名称英文描述
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "业务名称英文描述")
|
|
||||||
private String businessNameEnglish;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否置顶 0:否 1:是
|
* 是否置顶 0:否 1:是
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -40,11 +40,6 @@ public class GwJobInfoVo {
|
||||||
@ExcelProperty(value = "岗位职责")
|
@ExcelProperty(value = "岗位职责")
|
||||||
private String postStatement;
|
private String postStatement;
|
||||||
|
|
||||||
/**
|
|
||||||
* 福利
|
|
||||||
*/
|
|
||||||
private String welfare;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 薪资范围
|
* 薪资范围
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.ruoyi.official.mapper;
|
||||||
import com.ruoyi.official.domain.GwJobInfo;
|
import com.ruoyi.official.domain.GwJobInfo;
|
||||||
import com.ruoyi.official.domain.vo.GwJobInfoVo;
|
import com.ruoyi.official.domain.vo.GwJobInfoVo;
|
||||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
import org.apache.ibatis.annotations.Update;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 招聘信息
|
* 招聘信息
|
||||||
|
@ -14,8 +13,4 @@ Mapper接口
|
||||||
*/
|
*/
|
||||||
public interface GwJobInfoMapper extends BaseMapperPlus<GwJobInfoMapper, GwJobInfo, GwJobInfoVo> {
|
public interface GwJobInfoMapper extends BaseMapperPlus<GwJobInfoMapper, GwJobInfo, GwJobInfoVo> {
|
||||||
|
|
||||||
//
|
|
||||||
@Update("UPDATE gw_job_info SET release_time = #{releaseTime} WHERE id = #{id}")
|
|
||||||
void updateReleaseTime(GwJobInfo gwJobInfo);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,12 @@
|
||||||
package com.ruoyi.official.service.impl;
|
package com.ruoyi.official.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.core.domain.PageQuery;
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.ruoyi.official.domain.GwSlideshow;
|
|
||||||
import com.ruoyi.official.domain.vo.GwSlideshowVo;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.official.domain.bo.GwJobInfoBo;
|
import com.ruoyi.official.domain.bo.GwJobInfoBo;
|
||||||
|
@ -21,11 +15,9 @@ import com.ruoyi.official.domain.GwJobInfo;
|
||||||
import com.ruoyi.official.mapper.GwJobInfoMapper;
|
import com.ruoyi.official.mapper.GwJobInfoMapper;
|
||||||
import com.ruoyi.official.service.IGwJobInfoService;
|
import com.ruoyi.official.service.IGwJobInfoService;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 招聘信息Service业务层处理
|
* 招聘信息Service业务层处理
|
||||||
|
@ -49,18 +41,16 @@ public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询招聘信息列表
|
* 查询招聘信息
|
||||||
|
列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<GwJobInfoVo> queryPageList(GwJobInfoBo bo, PageQuery pageQuery) {
|
public TableDataInfo<GwJobInfoVo> queryPageList(GwJobInfoBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<GwJobInfo> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<GwJobInfo> lqw = buildQueryWrapper(bo);
|
||||||
Page<GwJobInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<GwJobInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询招聘信息
|
* 查询招聘信息
|
||||||
列表
|
列表
|
||||||
|
@ -77,7 +67,7 @@ public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getJobName()), GwJobInfo::getJobName, bo.getJobName());
|
lqw.like(StringUtils.isNotBlank(bo.getJobName()), GwJobInfo::getJobName, bo.getJobName());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getPostStatement()), GwJobInfo::getPostStatement, bo.getPostStatement());
|
lqw.eq(StringUtils.isNotBlank(bo.getPostStatement()), GwJobInfo::getPostStatement, bo.getPostStatement());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getSalaryRange()), GwJobInfo::getSalaryRange, bo.getSalaryRange());
|
lqw.eq(StringUtils.isNotBlank(bo.getSalaryRange()), GwJobInfo::getSalaryRange, bo.getSalaryRange());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getBaseSite()), GwJobInfo::getBaseSite, bo.getBaseSite());
|
lqw.eq(StringUtils.isNotBlank(bo.getBaseSite()), GwJobInfo::getBaseSite, bo.getBaseSite());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getEducation()), GwJobInfo::getEducation, bo.getEducation());
|
lqw.eq(StringUtils.isNotBlank(bo.getEducation()), GwJobInfo::getEducation, bo.getEducation());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getAgeRange()), GwJobInfo::getAgeRange, bo.getAgeRange());
|
lqw.eq(StringUtils.isNotBlank(bo.getAgeRange()), GwJobInfo::getAgeRange, bo.getAgeRange());
|
||||||
lqw.eq(bo.getReleaseTime() != null, GwJobInfo::getReleaseTime, bo.getReleaseTime());
|
lqw.eq(bo.getReleaseTime() != null, GwJobInfo::getReleaseTime, bo.getReleaseTime());
|
||||||
|
@ -87,8 +77,6 @@ public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getReleaseState()), GwJobInfo::getReleaseState, bo.getReleaseState());
|
lqw.eq(StringUtils.isNotBlank(bo.getReleaseState()), GwJobInfo::getReleaseState, bo.getReleaseState());
|
||||||
lqw.eq(bo.getCreateUserId() != null, GwJobInfo::getCreateUserId, bo.getCreateUserId());
|
lqw.eq(bo.getCreateUserId() != null, GwJobInfo::getCreateUserId, bo.getCreateUserId());
|
||||||
lqw.eq(bo.getUpdateUserId() != null, GwJobInfo::getUpdateUserId, bo.getUpdateUserId());
|
lqw.eq(bo.getUpdateUserId() != null, GwJobInfo::getUpdateUserId, bo.getUpdateUserId());
|
||||||
lqw.orderByDesc(GwJobInfo::getIsTop);
|
|
||||||
lqw.orderByDesc(GwJobInfo::getReleaseTime);
|
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,16 +102,7 @@ public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateByBo(GwJobInfoBo bo) {
|
public Boolean updateByBo(GwJobInfoBo bo) {
|
||||||
GwJobInfo update = BeanUtil.toBean(bo, GwJobInfo.class);
|
GwJobInfo update = BeanUtil.toBean(bo, GwJobInfo.class);
|
||||||
GwJobInfoVo gwJobInfoVo = baseMapper.selectVoById(bo.getId());
|
validEntityBeforeSave(update);
|
||||||
//判断之前是否为发布状态
|
|
||||||
if (ObjectUtil.equal(update.getReleaseState(),"0")){
|
|
||||||
update.setReleaseTime(null);
|
|
||||||
baseMapper.updateReleaseTime(update);
|
|
||||||
};
|
|
||||||
//判断之前是否为发布状态
|
|
||||||
if (ObjectUtil.equal(update.getReleaseState(),"1")&&ObjectUtil.equal(gwJobInfoVo.getReleaseState(),"0"))update.setReleaseTime(new Date());
|
|
||||||
//置顶校验
|
|
||||||
validIsTop(BeanUtil.toBean(bo,GwJobInfo.class));
|
|
||||||
return baseMapper.updateById(update) > 0;
|
return baseMapper.updateById(update) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,29 +111,6 @@ public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
||||||
*/
|
*/
|
||||||
private void validEntityBeforeSave(GwJobInfo entity){
|
private void validEntityBeforeSave(GwJobInfo entity){
|
||||||
//TODO 做一些数据校验,如唯一约束
|
//TODO 做一些数据校验,如唯一约束
|
||||||
//发布时间校验
|
|
||||||
if(ObjectUtil.equal(entity.getReleaseState(),"1")){
|
|
||||||
entity.setReleaseTime(new Date());
|
|
||||||
}
|
|
||||||
validIsTop(entity);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 置顶校验
|
|
||||||
*/
|
|
||||||
private void validIsTop(GwJobInfo entity) {
|
|
||||||
if (!ObjectUtil.equal(entity.getIsTop(),"1")) return;
|
|
||||||
//存在想置顶得数据,将原来得数据修改为非置顶
|
|
||||||
List<GwJobInfoVo> vos = baseMapper.selectVoList(Wrappers.<GwJobInfo>lambdaQuery().eq(GwJobInfo::getIsTop, "1"));
|
|
||||||
if ( CollUtil.isEmpty(vos)) return;
|
|
||||||
UpdateWrapper<GwJobInfo> updateWrapper = new UpdateWrapper<>();
|
|
||||||
|
|
||||||
vos.stream().forEach(ixt->{
|
|
||||||
// updateWrapper.("id", list).set("is_top", "0");
|
|
||||||
updateWrapper.eq("id",ixt.getId()).set("is_top", "0");
|
|
||||||
baseMapper.update(BeanUtil.toBean(ixt,GwJobInfo.class),updateWrapper);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -43,8 +43,7 @@ public class GwSlideshowServiceImpl implements IGwSlideshowService {
|
||||||
public GwSlideshowVo queryById(Long id) {
|
public GwSlideshowVo queryById(Long id) {
|
||||||
GwSlideshowVo gwSlideshowVo = baseMapper.selectVoById(id);
|
GwSlideshowVo gwSlideshowVo = baseMapper.selectVoById(id);
|
||||||
//查询详情时返回上一篇,下一篇处理
|
//查询详情时返回上一篇,下一篇处理
|
||||||
List<GwSlideshow> list = baseMapper.selectList(Wrappers.<GwSlideshow>lambdaQuery().eq(GwSlideshow::getType,gwSlideshowVo.getType()).orderByDesc(GwSlideshow::getIsTop).orderByDesc(GwSlideshow::getCreateTime));
|
List<GwSlideshow> list = baseMapper.selectList(Wrappers.<GwSlideshow>lambdaQuery().orderByDesc(GwSlideshow::getCreateTime));
|
||||||
//获取文章推荐内容
|
|
||||||
getPrevNextArticles(id, gwSlideshowVo, list);
|
getPrevNextArticles(id, gwSlideshowVo, list);
|
||||||
return gwSlideshowVo;
|
return gwSlideshowVo;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +70,12 @@ public class GwSlideshowServiceImpl implements IGwSlideshowService {
|
||||||
public TableDataInfo<GwSlideshowVo> queryPageList(GwSlideshowBo bo, PageQuery pageQuery) {
|
public TableDataInfo<GwSlideshowVo> queryPageList(GwSlideshowBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<GwSlideshow> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<GwSlideshow> lqw = buildQueryWrapper(bo);
|
||||||
Page<GwSlideshowVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<GwSlideshowVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
if (CollUtil.isNotEmpty(result.getRecords())){
|
||||||
|
List<GwSlideshowVo> records = result.getRecords();
|
||||||
|
List<GwSlideshowVo> fist = records.stream().filter(itx -> itx.getIsTop().equals("1")).collect(Collectors.toList());
|
||||||
|
fist.addAll(records.stream().filter(itx->!itx.getIsTop().equals("1")).collect(Collectors.toList()));
|
||||||
|
result.setRecords(fist);
|
||||||
|
}
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +99,6 @@ public class GwSlideshowServiceImpl implements IGwSlideshowService {
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getType()), GwSlideshow::getType, bo.getType());
|
lqw.eq(StringUtils.isNotBlank(bo.getType()), GwSlideshow::getType, bo.getType());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getAbstracts()), GwSlideshow::getAbstracts, bo.getAbstracts());
|
lqw.eq(StringUtils.isNotBlank(bo.getAbstracts()), GwSlideshow::getAbstracts, bo.getAbstracts());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getIsTop()), GwSlideshow::getIsTop, bo.getIsTop());
|
lqw.eq(StringUtils.isNotBlank(bo.getIsTop()), GwSlideshow::getIsTop, bo.getIsTop());
|
||||||
lqw.orderByDesc(GwSlideshow::getIsTop);
|
|
||||||
lqw.orderByDesc(GwSlideshow::getReleaseTime);
|
lqw.orderByDesc(GwSlideshow::getReleaseTime);
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user