|
|
@ -9,8 +9,10 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
import com.ruoyi.common.utils.PageUtils;
|
|
|
|
import com.ruoyi.common.utils.PageUtils;
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
|
|
|
import com.ruoyi.database.domain.DevopsDeviceInfo;
|
|
|
|
import com.ruoyi.database.domain.TransitImpUserRecord;
|
|
|
|
import com.ruoyi.database.domain.TransitImpUserRecord;
|
|
|
|
import com.ruoyi.database.domain.TransitImpVehicleRecord;
|
|
|
|
import com.ruoyi.database.domain.TransitImpVehicleRecord;
|
|
|
|
|
|
|
|
import com.ruoyi.database.service.DevopsDeviceInfoService;
|
|
|
|
import com.ruoyi.database.service.TransitImpVehicleRecordService;
|
|
|
|
import com.ruoyi.database.service.TransitImpVehicleRecordService;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
@ -20,10 +22,13 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 重点人车辆记录表(TransitImpVehicleRecord)Controller
|
|
|
|
* 重点人车辆记录表(TransitImpVehicleRecord)Controller
|
|
|
@ -38,32 +43,42 @@ import java.util.List;
|
|
|
|
public class TransitImpVehicleRecordController extends BaseController {
|
|
|
|
public class TransitImpVehicleRecordController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
private final TransitImpVehicleRecordService transitImpVehicleRecordService;
|
|
|
|
private final TransitImpVehicleRecordService transitImpVehicleRecordService;
|
|
|
|
|
|
|
|
private final DevopsDeviceInfoService devopsDeviceInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping
|
|
|
|
@GetMapping
|
|
|
|
@ApiOperation("查询重点人车辆记录表")
|
|
|
|
@ApiOperation("查询重点人车辆记录表")
|
|
|
|
public TableDataInfo<TransitImpVehicleRecord> list(TransitImpVehicleRecord transitImpVehicleRecord) throws Exception{
|
|
|
|
public TableDataInfo<TransitImpVehicleRecord> list(TransitImpVehicleRecord transitImpVehicleRecord) throws Exception{
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
List<DevopsDeviceInfo> deviceInfos = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getParentMonitoringType, 1).list();
|
|
|
|
|
|
|
|
List<String> collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList());
|
|
|
|
QueryWrapper<TransitImpVehicleRecord> queryWrapper = new QueryWrapper<>(transitImpVehicleRecord);
|
|
|
|
QueryWrapper<TransitImpVehicleRecord> queryWrapper = new QueryWrapper<>(transitImpVehicleRecord);
|
|
|
|
if (transitImpVehicleRecord.getFirstTime() != null && transitImpVehicleRecord.getEndTime() != null) {
|
|
|
|
queryWrapper.in("device_code",collect);
|
|
|
|
queryWrapper.between("partition_field", transitImpVehicleRecord.getFirstTime(), transitImpVehicleRecord.getEndTime());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (transitImpVehicleRecord.getFirstTime() != null){
|
|
|
|
if (transitImpVehicleRecord.getFirstTime() != null){
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
calendar.setTime(simpleDateFormat.parse(transitImpVehicleRecord.getFirstTime()));
|
|
|
|
calendar.setTime(simpleDateFormat.parse(transitImpVehicleRecord.getFirstTime()));
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
queryWrapper.between("partition_field", transitImpVehicleRecord.getFirstTime(),simpleDateFormat.format(calendar.getTime()));
|
|
|
|
queryWrapper.between("partition_field", transitImpVehicleRecord.getFirstTime(),simpleDateFormat.format(calendar.getTime()));
|
|
|
|
|
|
|
|
queryWrapper.orderByDesc("partition_field");
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
|
|
|
LocalDateTime minusDay = now.minusDays(1);
|
|
|
|
|
|
|
|
queryWrapper.between("partition_field",formatter.format(minusDay),formatter.format(now));
|
|
|
|
|
|
|
|
queryWrapper.orderByDesc("partition_field");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int count = transitImpVehicleRecordService.count(queryWrapper);
|
|
|
|
int count = transitImpVehicleRecordService.count(queryWrapper);
|
|
|
|
PageUtils.startPage();
|
|
|
|
PageUtils.startPage();
|
|
|
|
List<TransitImpVehicleRecord> list = transitImpVehicleRecordService.list(queryWrapper);
|
|
|
|
List<TransitImpVehicleRecord> list = transitImpVehicleRecordService.list(queryWrapper);
|
|
|
|
List<TransitImpVehicleRecord> impVehicleRecords = new ArrayList<>();
|
|
|
|
List<TransitImpVehicleRecord> impVehicleRecords = new ArrayList<>();
|
|
|
|
for (TransitImpVehicleRecord transitImpVehicleRecord1 : list){
|
|
|
|
for (TransitImpVehicleRecord transitImpVehicleRecord1 : list){
|
|
|
|
|
|
|
|
if (!"unknown".equals(transitImpVehicleRecord1.getPlateNo())) {
|
|
|
|
Date partitionField = transitImpVehicleRecord1.getPartitionField();
|
|
|
|
Date partitionField = transitImpVehicleRecord1.getPartitionField();
|
|
|
|
String format = dateFormat.format(partitionField);
|
|
|
|
String format = dateFormat.format(partitionField);
|
|
|
|
transitImpVehicleRecord1.setElapsedTime(format);
|
|
|
|
transitImpVehicleRecord1.setElapsedTime(format);
|
|
|
|
impVehicleRecords.add(transitImpVehicleRecord1);
|
|
|
|
impVehicleRecords.add(transitImpVehicleRecord1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
TableDataInfo dataTable = getDataTable(impVehicleRecords);
|
|
|
|
TableDataInfo dataTable = getDataTable(impVehicleRecords);
|
|
|
|
dataTable.setTotal(count);
|
|
|
|
dataTable.setTotal(count);
|
|
|
|
return dataTable;
|
|
|
|
return dataTable;
|
|
|
|