develop
hanrenchun 10 months ago
parent 30b92a7b53
commit b24fb982e0

@ -10,9 +10,11 @@ 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.TransitUserRecord; import com.ruoyi.database.domain.TransitUserRecord;
import com.ruoyi.database.domain.vo.TransitUserRecordVO; import com.ruoyi.database.domain.vo.TransitUserRecordVO;
import com.ruoyi.database.service.DevopsDeviceInfoService;
import com.ruoyi.database.service.TransitImpUserRecordService; import com.ruoyi.database.service.TransitImpUserRecordService;
import com.ruoyi.database.service.TransitUserRecordService; import com.ruoyi.database.service.TransitUserRecordService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -30,6 +32,7 @@ import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* (TransitUserRecord)Controller * (TransitUserRecord)Controller
@ -45,16 +48,28 @@ public class TransitUserRecordController extends BaseController {
private final TransitUserRecordService transitUserRecordService; private final TransitUserRecordService transitUserRecordService;
private final TransitImpUserRecordService transitImpUserRecordService; private final TransitImpUserRecordService transitImpUserRecordService;
private final DevopsDeviceInfoService devopsDeviceInfoService;
@GetMapping @GetMapping
@ApiOperation("查询人脸记录表") @ApiOperation("查询人脸记录表")
public TableDataInfo<TransitUserRecord> list(TransitUserRecord transitUserRecord) throws Exception { public TableDataInfo<TransitUserRecord> list(TransitUserRecord transitUserRecord) throws Exception {
startPage(); startPage();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now(); DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDateTime minusDay = now.minusDays(1); List<DevopsDeviceInfo> deviceInfos = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getParentMonitoringType, 1).list();
List<String> collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList());
QueryWrapper<TransitUserRecord> queryWrapper = new QueryWrapper<>(transitUserRecord); QueryWrapper<TransitUserRecord> queryWrapper = new QueryWrapper<>(transitUserRecord);
queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now)); queryWrapper.in("device_code",collect);
if (transitUserRecord.getFirstTime() == null) {
LocalDateTime now = LocalDateTime.now();
LocalDateTime minusDay = now.minusDays(1);
queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now));
}else {
LocalDate date = LocalDate.parse(transitUserRecord.getFirstTime(), formatter1);
LocalDate nextDay = date.plusDays(1);
String nextDayString = nextDay.format(formatter1);
queryWrapper.between("partition_field", transitUserRecord.getFirstTime(), nextDayString);
}
queryWrapper.orderByDesc("partition_field"); queryWrapper.orderByDesc("partition_field");
List<TransitUserRecord> list = transitUserRecordService.list(queryWrapper); List<TransitUserRecord> list = transitUserRecordService.list(queryWrapper);
return getDataTable(list); return getDataTable(list);

@ -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");
LocalDateTime now = LocalDateTime.now(); DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDateTime minusDay = now.minusDays(1); 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<TransitVehicleRecord> queryWrapper = new QueryWrapper<>(transitVehicleRecord);
queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now)); queryWrapper.in("doorway_code",collect);
if (transitVehicleRecord.getFirstTime() == null) {
LocalDateTime now = LocalDateTime.now();
LocalDateTime minusDay = now.minusDays(1);
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);

Loading…
Cancel
Save