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.TmsCarKeyDispatchMapper;
|
import com.ruoyi.tms.domain.TmsCarKeyDispatch;
|
import com.ruoyi.tms.service.ITmsCarKeyDispatchService;
|
import com.ruoyi.common.core.text.Convert;
|
|
/**
|
* 车钥匙分发记录Service业务层处理
|
*
|
* @author ruoyi
|
* @date 2025-12-08
|
*/
|
@Service
|
@Transactional(rollbackFor = Exception.class)
|
public class TmsCarKeyDispatchServiceImpl extends BaseService<TmsCarKeyDispatchMapper, TmsCarKeyDispatch> implements ITmsCarKeyDispatchService
|
{
|
protected final Logger logger = LoggerFactory.getLogger(getClass());
|
@Resource
|
private TmsCarKeyDispatchMapper tmsCarKeyDispatchMapper;
|
|
|
/**
|
* 查询车钥匙分发记录
|
*
|
* @param id 车钥匙分发记录ID
|
* @return 车钥匙分发记录
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Override
|
public TmsCarKeyDispatch selectTmsCarKeyDispatchById(Integer id)
|
{
|
return tmsCarKeyDispatchMapper.selectTmsCarKeyDispatchById(id);
|
}
|
|
/**
|
* 查询车钥匙分发记录 记录数
|
*
|
* @param tmsCarKeyDispatch 车钥匙分发记录
|
* @return 车钥匙分发记录集合
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Override
|
public int selectTmsCarKeyDispatchCount(TmsCarKeyDispatch tmsCarKeyDispatch)
|
{
|
return tmsCarKeyDispatchMapper.selectTmsCarKeyDispatchCount(tmsCarKeyDispatch);
|
}
|
|
/**
|
* 查询车钥匙分发记录列表
|
*
|
* @param tmsCarKeyDispatch 车钥匙分发记录
|
* @return 车钥匙分发记录
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Override
|
public List<TmsCarKeyDispatch> selectTmsCarKeyDispatchList(TmsCarKeyDispatch tmsCarKeyDispatch)
|
{
|
return tmsCarKeyDispatchMapper.selectTmsCarKeyDispatchList(tmsCarKeyDispatch);
|
}
|
|
/**
|
* 查询车钥匙分发记录列表 异步 导出
|
*
|
* @param tmsCarKeyDispatch 车钥匙分发记录
|
* @param exportKey 导出功能的唯一标识
|
* @return 车钥匙分发记录集合
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Async
|
@Override
|
public void export(TmsCarKeyDispatch tmsCarKeyDispatch,String exportKey) {
|
|
super.export(TmsCarKeyDispatch.class,exportKey,"tmsCarKeyDispatchData",(pageNum)->{
|
PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
|
return selectTmsCarKeyDispatchList(tmsCarKeyDispatch);
|
});
|
}
|
|
|
/**
|
* 新增车钥匙分发记录
|
*
|
* @param tmsCarKeyDispatch 车钥匙分发记录
|
* @return 结果
|
*/
|
@Override
|
public int insertTmsCarKeyDispatch(TmsCarKeyDispatch tmsCarKeyDispatch)
|
{
|
tmsCarKeyDispatch.setCreateTime(DateUtils.getNowDate());
|
return tmsCarKeyDispatchMapper.insertTmsCarKeyDispatch(tmsCarKeyDispatch);
|
}
|
|
/**
|
* 新增车钥匙分发记录[批量]
|
*
|
* @param tmsCarKeyDispatchs 车钥匙分发记录
|
* @return 结果
|
*/
|
@Override
|
public int insertTmsCarKeyDispatchBatch(List<TmsCarKeyDispatch> tmsCarKeyDispatchs)
|
{
|
int rows = tmsCarKeyDispatchMapper.insertTmsCarKeyDispatchBatch(tmsCarKeyDispatchs);
|
return rows;
|
}
|
|
/**
|
* 修改车钥匙分发记录
|
*
|
* @param tmsCarKeyDispatch 车钥匙分发记录
|
* @return 结果
|
*/
|
@Override
|
public int updateTmsCarKeyDispatch(TmsCarKeyDispatch tmsCarKeyDispatch)
|
{
|
tmsCarKeyDispatch.setUpdateTime(DateUtils.getNowDate());
|
return tmsCarKeyDispatchMapper.updateTmsCarKeyDispatch(tmsCarKeyDispatch);
|
}
|
|
/**
|
* 修改车钥匙分发记录[批量]
|
*
|
* @param tmsCarKeyDispatchs 车钥匙分发记录
|
* @return 结果
|
*/
|
@Override
|
public int updateTmsCarKeyDispatchBatch(List<TmsCarKeyDispatch> tmsCarKeyDispatchs){
|
return tmsCarKeyDispatchMapper.updateTmsCarKeyDispatchBatch(tmsCarKeyDispatchs);
|
}
|
|
/**
|
* 删除车钥匙分发记录对象
|
*
|
* @param ids 需要删除的数据ID
|
* @return 结果
|
*/
|
@Override
|
public int deleteTmsCarKeyDispatchByIds(String ids)
|
{
|
return deleteTmsCarKeyDispatchByIds(Convert.toIntArray(ids));
|
}
|
|
/**
|
* 删除车钥匙分发记录对象
|
*
|
*
|
* @param ids 需要删除的数据ID
|
* @return 结果
|
*/
|
@Override
|
public int deleteTmsCarKeyDispatchByIds(Integer[] ids)
|
{
|
return tmsCarKeyDispatchMapper.deleteTmsCarKeyDispatchByIds(ids);
|
}
|
|
/**
|
* 删除车钥匙分发记录信息
|
*
|
* @param id 车钥匙分发记录ID
|
* @return 结果
|
*/
|
@Override
|
public int deleteTmsCarKeyDispatchById(Integer id)
|
{
|
return tmsCarKeyDispatchMapper.deleteTmsCarKeyDispatchById(id);
|
}
|
}
|