152 lines
3.3 KiB
Java
152 lines
3.3 KiB
Java
package com.muyu.system.service.impl;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.muyu.common.security.service.TokenService;
|
|
import com.muyu.common.system.domain.LoginUser;
|
|
import com.muyu.system.domain.SysNotice;
|
|
import com.muyu.system.mapper.SysNoticeMapper;
|
|
import com.muyu.system.service.SysNoticeService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 公告 服务层实现
|
|
*
|
|
* @author muyu
|
|
*/
|
|
@Service
|
|
public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService {
|
|
@Autowired
|
|
private SysNoticeMapper noticeMapper;
|
|
|
|
|
|
@Autowired
|
|
private TokenService tokenService;
|
|
/**
|
|
* 查询公告信息
|
|
*
|
|
* @param noticeId 公告ID
|
|
*
|
|
* @return 公告信息
|
|
*/
|
|
@Override
|
|
public SysNotice selectNoticeById (Long noticeId) {
|
|
return noticeMapper.selectNoticeById(noticeId);
|
|
}
|
|
|
|
/**
|
|
* 查询公告列表
|
|
*
|
|
* @param notice 公告信息
|
|
*
|
|
* @return 公告集合
|
|
*/
|
|
@Override
|
|
public List<SysNotice> selectNoticeList (SysNotice notice) {
|
|
return noticeMapper.selectNoticeList(notice);
|
|
}
|
|
|
|
/**
|
|
* 新增公告
|
|
*
|
|
* @param notice 公告信息
|
|
*
|
|
* @return 结果
|
|
*/
|
|
@Override
|
|
public int insertNotice (SysNotice notice) {
|
|
return noticeMapper.insertNotice(notice);
|
|
}
|
|
|
|
/**
|
|
* 修改公告
|
|
*
|
|
* @param notice 公告信息
|
|
*
|
|
* @return 结果
|
|
*/
|
|
@Override
|
|
public int updateNotice (SysNotice notice) {
|
|
return noticeMapper.updateNotice(notice);
|
|
}
|
|
|
|
/**
|
|
* 删除公告对象
|
|
*
|
|
* @param noticeId 公告ID
|
|
*
|
|
* @return 结果
|
|
*/
|
|
@Override
|
|
public int deleteNoticeById (Long noticeId) {
|
|
return noticeMapper.deleteNoticeById(noticeId);
|
|
}
|
|
|
|
/**
|
|
* 批量删除公告信息
|
|
*
|
|
* @param noticeIds 需要删除的公告ID
|
|
*
|
|
* @return 结果
|
|
*/
|
|
@Override
|
|
public int deleteNoticeByIds (Long[] noticeIds) {
|
|
return noticeMapper.deleteNoticeByIds(noticeIds);
|
|
}
|
|
|
|
@Override
|
|
public List<SysNotice> cementList() {
|
|
return noticeMapper.cementList();
|
|
}
|
|
|
|
@Override
|
|
public List<SysNotice> commentList() {
|
|
return noticeMapper.commentList();
|
|
}
|
|
|
|
@Override
|
|
public List<SysNotice> readNoticeList() {
|
|
return noticeMapper.readNoticeList();
|
|
}
|
|
|
|
@Override
|
|
public List<SysNotice> notReadNoticeList() {
|
|
return noticeMapper.notReadNoticeList();
|
|
}
|
|
|
|
@Override
|
|
public int totalQuantityAdvised() {
|
|
|
|
LoginUser loginUser = tokenService.getLoginUser();
|
|
|
|
int count=noticeMapper.totalQuantityAdvised(loginUser.getUserid());
|
|
|
|
return count;
|
|
}
|
|
|
|
@Override
|
|
public int totalRead() {
|
|
LoginUser loginUser = tokenService.getLoginUser();
|
|
|
|
int count=noticeMapper.totalRead(loginUser.getUserid());
|
|
|
|
return count;
|
|
}
|
|
|
|
@Override
|
|
public int totalNotRead() {
|
|
LoginUser loginUser = tokenService.getLoginUser();
|
|
|
|
int count=noticeMapper.totalNotRead(loginUser.getUserid());
|
|
|
|
return count;
|
|
}
|
|
|
|
@Override
|
|
public int readUpdStatus(Integer noticeId) {
|
|
return noticeMapper.readUpdStatus(noticeId);
|
|
}
|
|
}
|