Commit 1b4c5101 by 邓实川 Committed by chenzg

企业讯息bug

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