|
|
@ -12,11 +12,9 @@ import com.ruoyi.common.enums.BusinessType;
|
|
|
|
import com.ruoyi.common.utils.PageUtils;
|
|
|
|
import com.ruoyi.common.utils.PageUtils;
|
|
|
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
import com.ruoyi.database.domain.BoneVehicle;
|
|
|
|
import com.ruoyi.database.domain.*;
|
|
|
|
import com.ruoyi.database.domain.TransitImpVehicleRecord;
|
|
|
|
|
|
|
|
import com.ruoyi.database.domain.TransitUserRecord;
|
|
|
|
|
|
|
|
import com.ruoyi.database.domain.TransitVehicleRecord;
|
|
|
|
|
|
|
|
import com.ruoyi.database.service.BoneVehicleService;
|
|
|
|
import com.ruoyi.database.service.BoneVehicleService;
|
|
|
|
|
|
|
|
import com.ruoyi.database.service.DevopsDeviceInfoService;
|
|
|
|
import com.ruoyi.database.service.TransitImpVehicleRecordService;
|
|
|
|
import com.ruoyi.database.service.TransitImpVehicleRecordService;
|
|
|
|
import com.ruoyi.database.service.TransitVehicleRecordService;
|
|
|
|
import com.ruoyi.database.service.TransitVehicleRecordService;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
@ -26,11 +24,13 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 车辆记录表(TransitVehicleRecord)Controller
|
|
|
|
* 车辆记录表(TransitVehicleRecord)Controller
|
|
|
@ -46,16 +46,28 @@ public class TransitVehicleRecordController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
private final TransitVehicleRecordService transitVehicleRecordService;
|
|
|
|
private final TransitVehicleRecordService transitVehicleRecordService;
|
|
|
|
private final TransitImpVehicleRecordService transitImpVehicleRecordService;
|
|
|
|
private final TransitImpVehicleRecordService transitImpVehicleRecordService;
|
|
|
|
|
|
|
|
private final DevopsDeviceInfoService devopsDeviceInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping
|
|
|
|
@GetMapping
|
|
|
|
@ApiOperation("查询车辆记录表")
|
|
|
|
@ApiOperation("查询车辆记录表")
|
|
|
|
public TableDataInfo<TransitVehicleRecord> list(TransitVehicleRecord transitVehicleRecord) {
|
|
|
|
public TableDataInfo<TransitVehicleRecord> list(TransitVehicleRecord transitVehicleRecord) {
|
|
|
|
startPage();
|
|
|
|
startPage();
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
|
|
|
List<DevopsDeviceInfo> deviceInfos = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getParentMonitoringType, 1).list();
|
|
|
|
|
|
|
|
List<String> collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList());
|
|
|
|
|
|
|
|
QueryWrapper<TransitVehicleRecord> queryWrapper = new QueryWrapper<>(transitVehicleRecord);
|
|
|
|
|
|
|
|
queryWrapper.in("doorway_code",collect);
|
|
|
|
|
|
|
|
if (transitVehicleRecord.getFirstTime() == null) {
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
LocalDateTime minusDay = now.minusDays(1);
|
|
|
|
LocalDateTime minusDay = now.minusDays(1);
|
|
|
|
QueryWrapper<TransitVehicleRecord> queryWrapper = new QueryWrapper<>(transitVehicleRecord);
|
|
|
|
|
|
|
|
queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now));
|
|
|
|
queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now));
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
LocalDate date = LocalDate.parse(transitVehicleRecord.getFirstTime(), formatter1);
|
|
|
|
|
|
|
|
LocalDate nextDay = date.plusDays(1);
|
|
|
|
|
|
|
|
String nextDayString = nextDay.format(formatter1);
|
|
|
|
|
|
|
|
queryWrapper.between("partition_field", transitVehicleRecord.getFirstTime(), nextDayString);
|
|
|
|
|
|
|
|
}
|
|
|
|
queryWrapper.orderByDesc("partition_field");
|
|
|
|
queryWrapper.orderByDesc("partition_field");
|
|
|
|
List<TransitVehicleRecord> list = transitVehicleRecordService.list(queryWrapper);
|
|
|
|
List<TransitVehicleRecord> list = transitVehicleRecordService.list(queryWrapper);
|
|
|
|
return getDataTable(list);
|
|
|
|
return getDataTable(list);
|
|
|
|