package com.ruoyi.system.service.impl;
|
|
import java.util.List;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import com.ruoyi.system.mapper.GpsCollectLogMapper;
|
import com.ruoyi.system.domain.GpsCollectLog;
|
import com.ruoyi.system.service.IGpsCollectLogService;
|
import com.ruoyi.system.exception.ServiceException;
|
|
/**
|
* GPS采集日志Service业务层处理
|
*/
|
@Service
|
public class GpsCollectLogServiceImpl implements IGpsCollectLogService {
|
@Autowired
|
private GpsCollectLogMapper gpsCollectLogMapper;
|
|
/**
|
* 查询GPS采集日志
|
*/
|
@Override
|
public GpsCollectLog selectGpsCollectLogById(Long logId) {
|
return gpsCollectLogMapper.selectGpsCollectLogById(logId);
|
}
|
|
/**
|
* 查询GPS采集日志列表
|
*/
|
@Override
|
public List<GpsCollectLog> selectGpsCollectLogList(GpsCollectLog gpsCollectLog) {
|
return gpsCollectLogMapper.selectGpsCollectLogList(gpsCollectLog);
|
}
|
|
/**
|
* 新增GPS采集日志
|
*/
|
@Override
|
public int insertGpsCollectLog(GpsCollectLog gpsCollectLog) {
|
// 根据车牌号获取车辆ID
|
Long vehicleId = gpsCollectLogMapper.getVehicleIdByNo(gpsCollectLog.getVehicleNo());
|
if (vehicleId == null) {
|
throw new ServiceException("未找到对应的车辆信息");
|
}
|
gpsCollectLog.setVehicleId(vehicleId);
|
return gpsCollectLogMapper.insertGpsCollectLog(gpsCollectLog);
|
}
|
|
/**
|
* 修改GPS采集日志
|
*/
|
@Override
|
public int updateGpsCollectLog(GpsCollectLog gpsCollectLog) {
|
// 根据车牌号获取车辆ID
|
Long vehicleId = gpsCollectLogMapper.getVehicleIdByNo(gpsCollectLog.getVehicleNo());
|
if (vehicleId == null) {
|
throw new ServiceException("未找到对应的车辆信息");
|
}
|
gpsCollectLog.setVehicleId(vehicleId);
|
return gpsCollectLogMapper.updateGpsCollectLog(gpsCollectLog);
|
}
|
|
/**
|
* 批量删除GPS采集日志
|
*/
|
@Override
|
public int deleteGpsCollectLogByIds(Long[] logIds) {
|
return gpsCollectLogMapper.deleteGpsCollectLogByIds(logIds);
|
}
|
|
/**
|
* 删除GPS采集日志信息
|
*/
|
@Override
|
public int deleteGpsCollectLogById(Long logId) {
|
return gpsCollectLogMapper.deleteGpsCollectLogById(logId);
|
}
|
}
|