Commit 1b4c5101 by 邓实川 Committed by chenzg

企业讯息bug

parent 692e6b3d
...@@ -358,8 +358,8 @@ public class CmsController { ...@@ -358,8 +358,8 @@ public class CmsController {
// 查询条件 // 查询条件
QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>(); QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("organization_id", userBean.getOrgCode()) queryWrapper.eq("organization_id", userBean.getOrgCode())
.select("id","publisher_name", "auditopinion", "modularid", "status", "title", "releasetime", "addeddate", "author", .select("id", "publisher_name", "auditopinion", "modularid", "status", "title", "releasetime",
"summary", "releasetype", "fmtpath") "addeddate", "author", "summary", "releasetype", "fmtpath")
.ne("status", 1).eq(t != null && t > -1, "modularid", t) .ne("status", 1).eq(t != null && t > -1, "modularid", t)
.between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "releasetime", .between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "releasetime",
!StrUtil.hasBlank(s) ? s : "1000-01-01 00:00:00", !StrUtil.hasBlank(s) ? s : "1000-01-01 00:00:00",
...@@ -526,17 +526,16 @@ public class CmsController { ...@@ -526,17 +526,16 @@ public class CmsController {
@ApiOperation(value = "设置默认轮播信息", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "设置默认轮播信息", httpMethod = "GET", notes = "接口发布说明")
public Result<Void> setDefault(@CurrentUser UserBean userBean, @PathVariable("id") Integer id) { public Result<Void> setDefault(@CurrentUser UserBean userBean, @PathVariable("id") Integer id) {
// 将所有设为非默认 // 将所有设为非默认
UpdateWrapper<CmsAnnouncement> updateWrapper = new UpdateWrapper<CmsAnnouncement>(); boolean cmsAnnouncement = CmsAnnouncement.builder().isDefault(0).build().update(
CmsAnnouncement q = CmsAnnouncement.builder().orgCode(userBean.getOrgCode()).isDefault(0).build(); new LambdaQueryWrapper<CmsAnnouncement>().eq(CmsAnnouncement::getOrgCode, userBean.getOrgCode()));
cmsAnnouncementMapper.update(q, updateWrapper);
// 根据id设为默认 // 根据id设为默认
updateWrapper.eq("id", id); if (cmsAnnouncement) {
CmsAnnouncement w = CmsAnnouncement.builder().orgCode(userBean.getOrgCode()).id(id).isDefault(1).build(); if (CmsAnnouncement.builder().id(id).isDefault(1).build().updateById())
cmsAnnouncementMapper.update(w, updateWrapper); return ResultUtil.success("设置成功");
else
// 返回成功 return ResultUtil.success("设置失败");
return ResultUtil.success("设置成功"); }
return ResultUtil.success("设置失败");
} }
} }
...@@ -11,7 +11,6 @@ import java.util.ArrayList; ...@@ -11,7 +11,6 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
......
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