| | |
| | | package com.ruoyi.project.system.service.impl;
|
| | |
|
| | | import java.time.LocalDateTime;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Objects;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.github.xiaoymin.knife4j.core.util.StrUtil;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.project.system.domain.SysDept;
|
| | | import com.ruoyi.project.system.domain.SysNotice;
|
| | | import com.ruoyi.project.system.domain.SysUser;
|
| | | import com.ruoyi.project.system.domain.SysUserDept;
|
| | | import com.ruoyi.project.system.mapper.SysDeptMapper;
|
| | | import com.ruoyi.project.system.mapper.SysNoticeMapper;
|
| | | import com.ruoyi.project.system.mapper.SysUserDeptMapper;
|
| | | import com.ruoyi.project.system.mapper.SysUserMapper;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Service;
|
| | | import com.ruoyi.project.system.domain.SysNotice;
|
| | | import com.ruoyi.project.system.mapper.SysNoticeMapper;
|
| | | import com.ruoyi.project.system.service.ISysNoticeService;
|
| | | import lombok.RequiredArgsConstructor;
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | /**
|
| | | * 公告 服务层实现
|
| | |
| | | * @author ruoyi
|
| | | */
|
| | | @Service
|
| | | @RequiredArgsConstructor
|
| | | public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService {
|
| | |
|
| | | @Autowired
|
| | | private SysNoticeMapper noticeMapper;
|
| | |
|
| | | @Autowired
|
| | | private SysUserMapper userMapper;
|
| | |
|
| | | @Autowired
|
| | | private SysDeptMapper deptMapper;
|
| | |
|
| | | @Autowired
|
| | | private SysUserDeptMapper userDeptMapper;
|
| | |
|
| | | @Autowired
|
| | | private final SysNoticeMapper noticeMapper;
|
| | | private final SysUserMapper userMapper;
|
| | | private final SysDeptMapper deptMapper;
|
| | | private final SysUserDeptMapper userDeptMapper;
|
| | | @Lazy
|
| | | private ISysNoticeService sysNoticeService;
|
| | |
|
| | | @Autowired
|
| | | private UnipushService unipushService;
|
| | | private final ISysNoticeService sysNoticeService;
|
| | | private final UnipushService unipushService;
|
| | |
|
| | | /**
|
| | | * 查询公告信息
|
| | |
| | | return sysNotice;
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public boolean appReadNotice(Long noticeId) {
|
| | | if (noticeId == null) {
|
| | | return false;
|
| | | }
|
| | | SysNotice sysNotice = noticeMapper.selectNoticeById(noticeId);
|
| | | if (sysNotice == null) {
|
| | | return false;
|
| | | }
|
| | | sysNotice.setStatus("1");
|
| | | return noticeMapper.update(null, Wrappers.<SysNotice>lambdaUpdate()
|
| | | .eq(SysNotice::getNoticeId, noticeId)
|
| | | .eq(SysNotice::getStatus, "0")
|
| | | .set(SysNotice::getStatus, "1")) > 0;
|
| | | }
|
| | | }
|