Compare commits
6 Commits
d69c862e66
...
3dc9354556
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3dc9354556 | ||
![]() |
cef67d95db | ||
![]() |
0fe4c00f8f | ||
![]() |
2b6f0ccfab | ||
![]() |
795eb2a154 | ||
![]() |
032d28a049 |
|
@ -22,14 +22,13 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
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;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 文件上传 控制层
|
||||
|
@ -45,6 +44,7 @@ public class SysOssController extends BaseController {
|
|||
|
||||
@Value("${file.BASE_FILE_SAVE_PATH}")
|
||||
private String uploadPath;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
|
||||
|
||||
private final ISysOssService iSysOssService;
|
||||
private final ISysImageService iSysImageService;
|
||||
|
@ -98,43 +98,30 @@ public class SysOssController extends BaseController {
|
|||
*/
|
||||
@Log(title = "本地文件上传", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addPartsUpload")
|
||||
public R<Map<String, String>> addPartsUpload(@RequestPart("file") MultipartFile file) {
|
||||
public R<Map<String, String>> addPartsUpload(@RequestPart("file") MultipartFile file, HttpServletRequest req) {
|
||||
Map<String,String> map=new HashMap<>();
|
||||
|
||||
String filePath=uploadPath+"/file/upload/";
|
||||
String realPath = req.getSession().getServletContext().getRealPath("/uploadFile/");
|
||||
String format = sdf.format(new Date());
|
||||
///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 {
|
||||
if (file.isEmpty()) {
|
||||
return R.warn("文件为空");
|
||||
}
|
||||
|
||||
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);
|
||||
file.transferTo(new File(realPath,newName));
|
||||
String filePath = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + "/uploadFile" + format + newName;
|
||||
Long image = iSysImageService.uploadImage(newName,filePath);
|
||||
map.put("url",filePath);
|
||||
map.put("fileName",newName);
|
||||
map.put("ossId",image.toString());
|
||||
return R.ok(map);
|
||||
} catch (IOException e) {
|
||||
return R.warn("文件上传失败: "+e);
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
return R.warn("文件上传失败!");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -132,6 +132,8 @@ security:
|
|||
- /**/*.jpg
|
||||
- # 配置白名单
|
||||
- /official/slideshow/**
|
||||
- /official/jobInfo/**
|
||||
- /official/index/**
|
||||
# 公共路径
|
||||
- /favicon.ico
|
||||
- /error
|
||||
|
|
|
@ -41,7 +41,7 @@ public class GwIndexController extends BaseController {
|
|||
/**
|
||||
* 查询首页封面信息列表
|
||||
*/
|
||||
@SaCheckPermission("official:index:list")
|
||||
/* @SaCheckPermission("official:index:list")*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GwIndexVo> list(GwIndexBo bo, PageQuery pageQuery) {
|
||||
return iGwIndexService.queryPageList(bo, pageQuery);
|
||||
|
|
|
@ -41,8 +41,7 @@ public class GwJobController extends BaseController {
|
|||
private final IGwJobService iGwJobService;
|
||||
|
||||
/**
|
||||
* 查询招聘信息
|
||||
列表
|
||||
* 查询招聘信息列表
|
||||
*/
|
||||
@SaCheckPermission("official:job:list")
|
||||
@GetMapping("/list")
|
||||
|
|
|
@ -41,18 +41,16 @@ public class GwJobInfoController extends BaseController {
|
|||
private final IGwJobInfoService iGwJobInfoService;
|
||||
|
||||
/**
|
||||
* 查询招聘信息
|
||||
列表
|
||||
* 查询招聘信息列表
|
||||
*/
|
||||
@SaCheckPermission("official:jobInfo:list")
|
||||
/* @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)
|
||||
|
@ -63,8 +61,7 @@ public class GwJobInfoController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取招聘信息
|
||||
详细信息
|
||||
* 获取招聘信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
|
|
|
@ -37,7 +37,7 @@ public class GwIndex extends BaseEntity {
|
|||
*/
|
||||
private String fileType;
|
||||
/**
|
||||
* 业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务
|
||||
* 业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务
|
||||
*/
|
||||
private String businessType;
|
||||
/**
|
||||
|
@ -48,6 +48,16 @@ public class GwIndex extends BaseEntity {
|
|||
* 图片标题英文描述
|
||||
*/
|
||||
private String titleEnglish;
|
||||
|
||||
/**
|
||||
* 业务名称英文描述
|
||||
*/
|
||||
private String businessNameEnglish;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private String orders;
|
||||
/**
|
||||
* 图片标题中文描述
|
||||
*/
|
||||
|
|
|
@ -39,8 +39,7 @@ public class GwJobInfo extends BaseEntity {
|
|||
/**
|
||||
* 薪资范围
|
||||
*/
|
||||
private String
|
||||
salaryRange;
|
||||
private String salaryRange;
|
||||
/**
|
||||
* 工作地点
|
||||
*/
|
||||
|
@ -53,6 +52,12 @@ public class GwJobInfo extends BaseEntity {
|
|||
* 年龄范围
|
||||
*/
|
||||
private String ageRange;
|
||||
|
||||
|
||||
/**
|
||||
* 福利
|
||||
*/
|
||||
private String welfare;
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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.EditGroup;
|
||||
import lombok.Data;
|
||||
|
@ -25,13 +26,13 @@ public class GwIndexBo extends BaseEntity {
|
|||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 图片上传地址
|
||||
*/
|
||||
@NotBlank(message = "图片上传地址不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
||||
private String imageurl;
|
||||
|
||||
/**
|
||||
|
@ -42,33 +43,45 @@ public class GwIndexBo extends BaseEntity {
|
|||
/**
|
||||
* 业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务
|
||||
*/
|
||||
@NotBlank(message = "业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务 不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
||||
private String businessType;
|
||||
|
||||
/**
|
||||
* 业务名称
|
||||
*/
|
||||
@NotBlank(message = "业务名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
||||
private String businessName;
|
||||
|
||||
/**
|
||||
* 图片标题英文描述
|
||||
*/
|
||||
@NotBlank(message = "图片标题英文描述不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
||||
private String titleEnglish;
|
||||
|
||||
/**
|
||||
* 图片标题中文描述
|
||||
*/
|
||||
@NotBlank(message = "图片标题中文描述不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
||||
private String titleChinese;
|
||||
|
||||
/**
|
||||
* 是否置顶 0:否 1:是
|
||||
*/
|
||||
@NotBlank(message = "是否置顶 0:否 1:是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
||||
private String isIndex;
|
||||
|
||||
|
||||
/**
|
||||
* 业务名称英文描述
|
||||
*/
|
||||
private String businessNameEnglish;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
|
||||
private String orders;
|
||||
|
||||
/**
|
||||
* 标题名称
|
||||
*/
|
||||
|
@ -78,13 +91,13 @@ public class GwIndexBo extends BaseEntity {
|
|||
/**
|
||||
* 创建者id
|
||||
*/
|
||||
@NotNull(message = "创建者id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 更新者id
|
||||
*/
|
||||
@NotNull(message = "更新者id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
||||
private Long updateUserId;
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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.EditGroup;
|
||||
import lombok.Data;
|
||||
|
@ -9,6 +10,7 @@ import javax.validation.constraints.*;
|
|||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 招聘信息
|
||||
|
@ -25,7 +27,7 @@ public class GwJobInfoBo extends BaseEntity {
|
|||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
@ -68,7 +70,8 @@ public class GwJobInfoBo extends BaseEntity {
|
|||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
@NotNull(message = "发布时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date releaseTime;
|
||||
|
||||
/**
|
||||
|
@ -77,6 +80,12 @@ public class GwJobInfoBo extends BaseEntity {
|
|||
@NotBlank(message = "是否置顶 0:否 1:是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String isTop;
|
||||
|
||||
|
||||
/**
|
||||
* 福利
|
||||
*/
|
||||
private String welfare;
|
||||
|
||||
/**
|
||||
* 岗位职责
|
||||
*/
|
||||
|
@ -98,13 +107,11 @@ public class GwJobInfoBo extends BaseEntity {
|
|||
/**
|
||||
* 创建者id
|
||||
*/
|
||||
@NotNull(message = "创建者id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 更新者id
|
||||
*/
|
||||
@NotNull(message = "更新者id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long updateUserId;
|
||||
|
||||
|
||||
|
|
|
@ -41,11 +41,18 @@ public class GwIndexVo {
|
|||
private String fileType;
|
||||
|
||||
/**
|
||||
* 业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务
|
||||
* 业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务
|
||||
*/
|
||||
@ExcelProperty(value = "业务类型 0:石油化工业务 1:基建业务 2:铁矿石业务 3:燃气业务 ")
|
||||
private String businessType;
|
||||
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
|
||||
private String orders;
|
||||
|
||||
/**
|
||||
* 业务名称
|
||||
*/
|
||||
|
@ -64,6 +71,12 @@ public class GwIndexVo {
|
|||
@ExcelProperty(value = "图片标题中文描述")
|
||||
private String titleChinese;
|
||||
|
||||
/**
|
||||
* 业务名称英文描述
|
||||
*/
|
||||
@ExcelProperty(value = "业务名称英文描述")
|
||||
private String businessNameEnglish;
|
||||
|
||||
/**
|
||||
* 是否置顶 0:否 1:是
|
||||
*/
|
||||
|
|
|
@ -40,6 +40,11 @@ public class GwJobInfoVo {
|
|||
@ExcelProperty(value = "岗位职责")
|
||||
private String postStatement;
|
||||
|
||||
/**
|
||||
* 福利
|
||||
*/
|
||||
private String welfare;
|
||||
|
||||
/**
|
||||
* 薪资范围
|
||||
*/
|
||||
|
|
|
@ -3,6 +3,7 @@ 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;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* 招聘信息
|
||||
|
@ -13,4 +14,8 @@ Mapper接口
|
|||
*/
|
||||
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,12 +1,18 @@
|
|||
package com.ruoyi.official.service.impl;
|
||||
|
||||
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.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 com.ruoyi.official.domain.GwSlideshow;
|
||||
import com.ruoyi.official.domain.vo.GwSlideshowVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.official.domain.bo.GwJobInfoBo;
|
||||
|
@ -15,9 +21,11 @@ import com.ruoyi.official.domain.GwJobInfo;
|
|||
import com.ruoyi.official.mapper.GwJobInfoMapper;
|
||||
import com.ruoyi.official.service.IGwJobInfoService;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 招聘信息Service业务层处理
|
||||
|
@ -41,16 +49,18 @@ public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询招聘信息
|
||||
列表
|
||||
* 查询招聘信息列表
|
||||
*/
|
||||
@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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询招聘信息
|
||||
列表
|
||||
|
@ -67,7 +77,7 @@ public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
|||
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.getSalaryRange()), GwJobInfo::getSalaryRange, bo.getSalaryRange());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBaseSite()), GwJobInfo::getBaseSite, bo.getBaseSite());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getBaseSite()), GwJobInfo::getBaseSite, bo.getBaseSite());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEducation()), GwJobInfo::getEducation, bo.getEducation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAgeRange()), GwJobInfo::getAgeRange, bo.getAgeRange());
|
||||
lqw.eq(bo.getReleaseTime() != null, GwJobInfo::getReleaseTime, bo.getReleaseTime());
|
||||
|
@ -77,6 +87,8 @@ public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
|||
lqw.eq(StringUtils.isNotBlank(bo.getReleaseState()), GwJobInfo::getReleaseState, bo.getReleaseState());
|
||||
lqw.eq(bo.getCreateUserId() != null, GwJobInfo::getCreateUserId, bo.getCreateUserId());
|
||||
lqw.eq(bo.getUpdateUserId() != null, GwJobInfo::getUpdateUserId, bo.getUpdateUserId());
|
||||
lqw.orderByDesc(GwJobInfo::getIsTop);
|
||||
lqw.orderByDesc(GwJobInfo::getReleaseTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
@ -102,7 +114,16 @@ public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
|||
@Override
|
||||
public Boolean updateByBo(GwJobInfoBo bo) {
|
||||
GwJobInfo update = BeanUtil.toBean(bo, GwJobInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
GwJobInfoVo gwJobInfoVo = baseMapper.selectVoById(bo.getId());
|
||||
//判断之前是否为发布状态
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -111,6 +132,29 @@ public class GwJobInfoServiceImpl implements IGwJobInfoService {
|
|||
*/
|
||||
private void validEntityBeforeSave(GwJobInfo entity){
|
||||
//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,7 +43,8 @@ public class GwSlideshowServiceImpl implements IGwSlideshowService {
|
|||
public GwSlideshowVo queryById(Long id) {
|
||||
GwSlideshowVo gwSlideshowVo = baseMapper.selectVoById(id);
|
||||
//查询详情时返回上一篇,下一篇处理
|
||||
List<GwSlideshow> list = baseMapper.selectList(Wrappers.<GwSlideshow>lambdaQuery().orderByDesc(GwSlideshow::getCreateTime));
|
||||
List<GwSlideshow> list = baseMapper.selectList(Wrappers.<GwSlideshow>lambdaQuery().eq(GwSlideshow::getType,gwSlideshowVo.getType()).orderByDesc(GwSlideshow::getIsTop).orderByDesc(GwSlideshow::getCreateTime));
|
||||
//获取文章推荐内容
|
||||
getPrevNextArticles(id, gwSlideshowVo, list);
|
||||
return gwSlideshowVo;
|
||||
}
|
||||
|
@ -70,12 +71,6 @@ public class GwSlideshowServiceImpl implements IGwSlideshowService {
|
|||
public TableDataInfo<GwSlideshowVo> queryPageList(GwSlideshowBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<GwSlideshow> lqw = buildQueryWrapper(bo);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -99,6 +94,7 @@ public class GwSlideshowServiceImpl implements IGwSlideshowService {
|
|||
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.getIsTop()), GwSlideshow::getIsTop, bo.getIsTop());
|
||||
lqw.orderByDesc(GwSlideshow::getIsTop);
|
||||
lqw.orderByDesc(GwSlideshow::getReleaseTime);
|
||||
return lqw;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user