Commit 876b26ce by 翁国栋 Committed by 284718418@qq.com

8小时后台--

应需求一定要展示前四张图片
parent 25c0e8c9
package cn.timer.api.controller.qyxx;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.*;
import cn.timer.api.utils.redis.RedisUtil;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
......@@ -88,18 +85,27 @@ public class CmsController {
*/
@GetMapping(value = "/zxqyxx")
@ApiOperation(value = "获取最新讯息的标题、发布时间", httpMethod = "GET", notes = "接口发布说明")
public Result<List<CmsContent>> groupbyTime(@CurrentUser UserBean userBean) {
public Result<Object> groupbyTime(@CurrentUser UserBean userBean) {
Map map = Maps.newHashMap();
Integer orgCode = userBean.getOrgCode();
QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>();
queryWrapper.select("id", "title", "author", "releasetime", "fmtpath").eq("releasestate", 0)
.eq("organization_id", orgCode).orderByDesc("releasetime").last("limit 6");
List<CmsContent> qynr = CmsContent.builder().build().selectList(queryWrapper);
return ResultUtil.data(qynr, "查询分类成功!");
/*应需求一定要展示前四张图片*/
QueryWrapper<CmsContent> qw = new QueryWrapper<>();
qw.select("fmtpath").eq("releasestate", 0).isNotNull("fmtpath").ne("fmtpath","")
.eq("organization_id", orgCode).orderByDesc("releasetime").last("limit 4");
List<CmsContent> picList = CmsContent.builder().build().selectList(qw);
map.put("list",qynr);
map.put("picList",picList);
return ResultUtil.data(map, "查询分类成功!");
}
/**
* 分类,获取标题和发布时间
*
*
*/
// @GetMapping(value = "/flhqqyxx")
// @ApiOperation(value = "获取首页分类讯息标题、发布时间", httpMethod = "GET", notes = "接口发布说明")
......@@ -132,7 +138,7 @@ public class CmsController {
/**
* 分类内容获取
*
*
*/
@GetMapping(value = "/getType")
@ApiOperation(value = "分类内容获取", httpMethod = "GET", notes = "接口发布说明")
......@@ -158,7 +164,7 @@ public class CmsController {
/**
* 获取分类
*
*
*/
@GetMapping(value = "/xxfl")
@ApiOperation(value = "获取分类", httpMethod = "GET", notes = "接口发布说明")
......@@ -321,7 +327,7 @@ public class CmsController {
cmsContentPage.getSize();
return ResultUtil.data(cmsContentPage, cmsContents, "企业OA讯息搜索成功");
}
/**
* 企业OA讯息查询
*/
......@@ -357,7 +363,7 @@ public class CmsController {
/**
* 根据id查讯息
*
*
* @param id
* @return
*/
......@@ -413,7 +419,7 @@ public class CmsController {
/**
* 讯息发布
*
*
* @param id
*/
@GetMapping(value = "/qyxxsdfb/{id}")
......@@ -432,7 +438,7 @@ public class CmsController {
/**
* 讯息收回
*
*
* @param id
*/
@GetMapping(value = "/qyxxtb/{id}")
......@@ -451,7 +457,7 @@ public class CmsController {
/**
* 添加已读
*
*
* @param userBean
* @param id
* @return
......@@ -477,7 +483,7 @@ public class CmsController {
/**
* 查询已读人
*
*
* @param userBean
* @param mid
* @return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment