Commit dd948a60 by 翁国栋

8小时后台--

应需求一定要展示前四张图片
parent ef0568de
package cn.timer.api.controller.qyxx; package cn.timer.api.controller.qyxx;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import cn.timer.api.utils.redis.RedisUtil; import cn.timer.api.utils.redis.RedisUtil;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
...@@ -88,18 +85,27 @@ public class CmsController { ...@@ -88,18 +85,27 @@ public class CmsController {
*/ */
@GetMapping(value = "/zxqyxx") @GetMapping(value = "/zxqyxx")
@ApiOperation(value = "获取最新讯息的标题、发布时间", httpMethod = "GET", notes = "接口发布说明") @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(); Integer orgCode = userBean.getOrgCode();
QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>(); QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>();
queryWrapper.select("id", "title", "author", "releasetime", "fmtpath").eq("releasestate", 0) queryWrapper.select("id", "title", "author", "releasetime", "fmtpath").eq("releasestate", 0)
.eq("organization_id", orgCode).orderByDesc("releasetime").last("limit 6"); .eq("organization_id", orgCode).orderByDesc("releasetime").last("limit 6");
List<CmsContent> qynr = CmsContent.builder().build().selectList(queryWrapper); 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") // @GetMapping(value = "/flhqqyxx")
// @ApiOperation(value = "获取首页分类讯息标题、发布时间", httpMethod = "GET", notes = "接口发布说明") // @ApiOperation(value = "获取首页分类讯息标题、发布时间", httpMethod = "GET", notes = "接口发布说明")
...@@ -132,7 +138,7 @@ public class CmsController { ...@@ -132,7 +138,7 @@ public class CmsController {
/** /**
* 分类内容获取 * 分类内容获取
* *
*/ */
@GetMapping(value = "/getType") @GetMapping(value = "/getType")
@ApiOperation(value = "分类内容获取", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "分类内容获取", httpMethod = "GET", notes = "接口发布说明")
...@@ -158,7 +164,7 @@ public class CmsController { ...@@ -158,7 +164,7 @@ public class CmsController {
/** /**
* 获取分类 * 获取分类
* *
*/ */
@GetMapping(value = "/xxfl") @GetMapping(value = "/xxfl")
@ApiOperation(value = "获取分类", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取分类", httpMethod = "GET", notes = "接口发布说明")
...@@ -321,7 +327,7 @@ public class CmsController { ...@@ -321,7 +327,7 @@ public class CmsController {
cmsContentPage.getSize(); cmsContentPage.getSize();
return ResultUtil.data(cmsContentPage, cmsContents, "企业OA讯息搜索成功"); return ResultUtil.data(cmsContentPage, cmsContents, "企业OA讯息搜索成功");
} }
/** /**
* 企业OA讯息查询 * 企业OA讯息查询
*/ */
...@@ -357,7 +363,7 @@ public class CmsController { ...@@ -357,7 +363,7 @@ public class CmsController {
/** /**
* 根据id查讯息 * 根据id查讯息
* *
* @param id * @param id
* @return * @return
*/ */
...@@ -413,7 +419,7 @@ public class CmsController { ...@@ -413,7 +419,7 @@ public class CmsController {
/** /**
* 讯息发布 * 讯息发布
* *
* @param id * @param id
*/ */
@GetMapping(value = "/qyxxsdfb/{id}") @GetMapping(value = "/qyxxsdfb/{id}")
...@@ -432,7 +438,7 @@ public class CmsController { ...@@ -432,7 +438,7 @@ public class CmsController {
/** /**
* 讯息收回 * 讯息收回
* *
* @param id * @param id
*/ */
@GetMapping(value = "/qyxxtb/{id}") @GetMapping(value = "/qyxxtb/{id}")
...@@ -451,7 +457,7 @@ public class CmsController { ...@@ -451,7 +457,7 @@ public class CmsController {
/** /**
* 添加已读 * 添加已读
* *
* @param userBean * @param userBean
* @param id * @param id
* @return * @return
...@@ -477,7 +483,7 @@ public class CmsController { ...@@ -477,7 +483,7 @@ public class CmsController {
/** /**
* 查询已读人 * 查询已读人
* *
* @param userBean * @param userBean
* @param mid * @param mid
* @return * @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