|
|
|
@ -2,6 +2,7 @@ package org.dromara.vehicle.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
@ -16,6 +17,7 @@ import org.dromara.gps.domain.GpsEquipment;
|
|
|
|
import org.dromara.gps.domain.GpsManmachine;
|
|
|
|
import org.dromara.gps.domain.GpsManmachine;
|
|
|
|
import org.dromara.gps.service.IGpsEquipmentService;
|
|
|
|
import org.dromara.gps.service.IGpsEquipmentService;
|
|
|
|
import org.dromara.gps.service.IGpsManmachineService;
|
|
|
|
import org.dromara.gps.service.IGpsManmachineService;
|
|
|
|
|
|
|
|
import org.dromara.system.service.ISysOssService;
|
|
|
|
import org.dromara.vehicle.domain.VehVehicleInfo;
|
|
|
|
import org.dromara.vehicle.domain.VehVehicleInfo;
|
|
|
|
import org.dromara.vehicle.domain.bo.VehVehicleInfoBo;
|
|
|
|
import org.dromara.vehicle.domain.bo.VehVehicleInfoBo;
|
|
|
|
import org.dromara.vehicle.domain.enums.VehVehicleInfoStatusEnum;
|
|
|
|
import org.dromara.vehicle.domain.enums.VehVehicleInfoStatusEnum;
|
|
|
|
@ -29,6 +31,7 @@ import org.springframework.context.annotation.Lazy;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
@ -57,6 +60,10 @@ public class VehVehicleInfoServiceImpl extends ServiceImpl<VehVehicleInfoMapper,
|
|
|
|
@Lazy
|
|
|
|
@Lazy
|
|
|
|
private IVehVehicleTripService vehVehicleTripService;
|
|
|
|
private IVehVehicleTripService vehVehicleTripService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
@Lazy
|
|
|
|
|
|
|
|
private ISysOssService ossService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询车辆信息
|
|
|
|
* 查询车辆信息
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -168,10 +175,24 @@ public class VehVehicleInfoServiceImpl extends ServiceImpl<VehVehicleInfoMapper,
|
|
|
|
* @return 是否删除成功
|
|
|
|
* @return 是否删除成功
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
if (isValid) {
|
|
|
|
if (isValid) {
|
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
List<VehVehicleInfoVo> vehVehicleInfoVos = baseMapper.selectVoByIds(ids);
|
|
|
|
|
|
|
|
for (VehVehicleInfoVo v : vehVehicleInfoVos) {
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(v.getFileIds())) {
|
|
|
|
|
|
|
|
String[] split = v.getFileIds().split(",");
|
|
|
|
|
|
|
|
List<Long> fileIds = Arrays.stream(split).map(Long::parseLong).toList();
|
|
|
|
|
|
|
|
ossService.deleteWithValidByIds(fileIds,false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(v.getVehicleIcon())) {
|
|
|
|
|
|
|
|
String[] split = v.getVehicleIcon().split(",");
|
|
|
|
|
|
|
|
List<Long> fileIds = Arrays.stream(split).map(Long::parseLong).toList();
|
|
|
|
|
|
|
|
ossService.deleteWithValidByIds(fileIds,false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|