package com.supersavedriving.driver.modular.system.service.impl;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
import com.supersavedriving.driver.modular.system.dao.SystemBulletinMapper;
|
import com.supersavedriving.driver.modular.system.dao.SystemBulletinUserMapper;
|
import com.supersavedriving.driver.modular.system.model.SystemBulletin;
|
import com.supersavedriving.driver.modular.system.model.SystemBulletinUser;
|
import com.supersavedriving.driver.modular.system.service.ISystemBulletinService;
|
import com.supersavedriving.driver.modular.system.warpper.SystemBulletinInfo;
|
import com.supersavedriving.driver.modular.system.warpper.SystemBulletinListWarpper;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
/**
|
* 系统公告
|
* @author pzb
|
* @Date 2023/2/13 11:18
|
*/
|
@Service
|
public class SystemBulletinServiceImpl extends ServiceImpl<SystemBulletinMapper, SystemBulletin> implements ISystemBulletinService {
|
|
@Resource
|
private SystemBulletinUserMapper systemBulletinUserMapper;
|
|
|
|
|
/**
|
* 获取公告列表
|
* @param uid 司机id
|
* @param pageNum 页码
|
* @param size 页条数
|
* @return
|
* @throws Exception
|
*/
|
@Override
|
public List<SystemBulletinListWarpper> querySystemBulletinList(Integer uid, Integer pageNum, Integer size) throws Exception {
|
pageNum = (pageNum - 1) * size;
|
return this.baseMapper.querySystemBulletinList(uid, pageNum, size);
|
}
|
|
|
/**
|
* 获取公告详情
|
* @param id
|
* @return
|
* @throws Exception
|
*/
|
@Override
|
public SystemBulletinInfo querySystemBulletinInfo(Long id) throws Exception {
|
SystemBulletinInfo systemBulletinInfo = this.baseMapper.querySystemBulletinInfo(id);
|
SystemBulletinUser systemBulletinUser = systemBulletinUserMapper.selectById(id);
|
systemBulletinUser.setIsRead(1);
|
systemBulletinUserMapper.updateById(systemBulletinUser);
|
return systemBulletinInfo;
|
}
|
|
@Override
|
public void clearSystemBulletinUser(Integer userId) throws Exception {
|
systemBulletinUserMapper.clearSystemBulletinUser(userId);
|
}
|
}
|