package com.ruoyi.tms.service.impl;
|
|
import java.util.List;
|
|
import com.ruoyi.common.utils.DateUtils;
|
import javax.annotation.Resource;
|
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.stereotype.Service;
|
import org.springframework.scheduling.annotation.Async;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import com.ruoyi.common.utils.PageUtils;
|
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.annotation.DataSource;
|
import com.ruoyi.common.enums.DataSourceType;
|
import com.ruoyi.common.core.service.BaseService;
|
|
import com.ruoyi.tms.mapper.TmsMessageNotifyMapper;
|
import com.ruoyi.tms.domain.TmsMessageNotify;
|
import com.ruoyi.tms.service.ITmsMessageNotifyService;
|
import com.ruoyi.common.core.text.Convert;
|
|
/**
|
* 消息通知Service业务层处理
|
*
|
* @author ruoyi
|
* @date 2025-11-26
|
*/
|
@Service
|
@Transactional(rollbackFor = Exception.class)
|
public class TmsMessageNotifyServiceImpl extends BaseService<TmsMessageNotifyMapper, TmsMessageNotify> implements ITmsMessageNotifyService
|
{
|
protected final Logger logger = LoggerFactory.getLogger(getClass());
|
@Resource
|
private TmsMessageNotifyMapper tmsMessageNotifyMapper;
|
|
|
/**
|
* 查询消息通知
|
*
|
* @param id 消息通知ID
|
* @return 消息通知
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Override
|
public TmsMessageNotify selectTmsMessageNotifyById(Integer id)
|
{
|
return tmsMessageNotifyMapper.selectTmsMessageNotifyById(id);
|
}
|
|
/**
|
* 查询消息通知 记录数
|
*
|
* @param tmsMessageNotify 消息通知
|
* @return 消息通知集合
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Override
|
public int selectTmsMessageNotifyCount(TmsMessageNotify tmsMessageNotify)
|
{
|
return tmsMessageNotifyMapper.selectTmsMessageNotifyCount(tmsMessageNotify);
|
}
|
|
/**
|
* 查询消息通知列表
|
*
|
* @param tmsMessageNotify 消息通知
|
* @return 消息通知
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Override
|
public List<TmsMessageNotify> selectTmsMessageNotifyList(TmsMessageNotify tmsMessageNotify)
|
{
|
return tmsMessageNotifyMapper.selectTmsMessageNotifyList(tmsMessageNotify);
|
}
|
|
/**
|
* 查询消息通知列表 异步 导出
|
*
|
* @param tmsMessageNotify 消息通知
|
* @param exportKey 导出功能的唯一标识
|
* @return 消息通知集合
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Async
|
@Override
|
public void export(TmsMessageNotify tmsMessageNotify,String exportKey) {
|
|
super.export(TmsMessageNotify.class,exportKey,"tmsMessageNotifyData",(pageNum)->{
|
PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
|
return selectTmsMessageNotifyList(tmsMessageNotify);
|
});
|
}
|
|
|
/**
|
* 新增消息通知
|
*
|
* @param tmsMessageNotify 消息通知
|
* @return 结果
|
*/
|
@Override
|
public int insertTmsMessageNotify(TmsMessageNotify tmsMessageNotify)
|
{
|
tmsMessageNotify.setCreateTime(DateUtils.getNowDate());
|
return tmsMessageNotifyMapper.insertTmsMessageNotify(tmsMessageNotify);
|
}
|
|
/**
|
* 新增消息通知[批量]
|
*
|
* @param tmsMessageNotifys 消息通知
|
* @return 结果
|
*/
|
@Override
|
public int insertTmsMessageNotifyBatch(List<TmsMessageNotify> tmsMessageNotifys)
|
{
|
int rows = tmsMessageNotifyMapper.insertTmsMessageNotifyBatch(tmsMessageNotifys);
|
return rows;
|
}
|
|
/**
|
* 修改消息通知
|
*
|
* @param tmsMessageNotify 消息通知
|
* @return 结果
|
*/
|
@Override
|
public int updateTmsMessageNotify(TmsMessageNotify tmsMessageNotify)
|
{
|
tmsMessageNotify.setUpdateTime(DateUtils.getNowDate());
|
return tmsMessageNotifyMapper.updateTmsMessageNotify(tmsMessageNotify);
|
}
|
|
/**
|
* 修改消息通知[批量]
|
*
|
* @param tmsMessageNotifys 消息通知
|
* @return 结果
|
*/
|
@Override
|
public int updateTmsMessageNotifyBatch(List<TmsMessageNotify> tmsMessageNotifys){
|
return tmsMessageNotifyMapper.updateTmsMessageNotifyBatch(tmsMessageNotifys);
|
}
|
|
/**
|
* 删除消息通知对象
|
*
|
* @param ids 需要删除的数据ID
|
* @return 结果
|
*/
|
@Override
|
public int deleteTmsMessageNotifyByIds(String ids)
|
{
|
return deleteTmsMessageNotifyByIds(Convert.toIntArray(ids));
|
}
|
|
/**
|
* 删除消息通知对象
|
*
|
*
|
* @param ids 需要删除的数据ID
|
* @return 结果
|
*/
|
@Override
|
public int deleteTmsMessageNotifyByIds(Integer[] ids)
|
{
|
return tmsMessageNotifyMapper.deleteTmsMessageNotifyByIds(ids);
|
}
|
|
/**
|
* 删除消息通知信息
|
*
|
* @param id 消息通知ID
|
* @return 结果
|
*/
|
@Override
|
public int deleteTmsMessageNotifyById(Integer id)
|
{
|
return tmsMessageNotifyMapper.deleteTmsMessageNotifyById(id);
|
}
|
}
|