|
|
@ -4,16 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
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.ssf.mysqloracletest.domain.BoneVehicle;
|
|
|
|
import com.ssf.mysqloracletest.domain.TMotorvehicle;
|
|
|
|
import com.ssf.mysqloracletest.domain.TMotorvehicle;
|
|
|
|
import com.ssf.mysqloracletest.domain.TStrhEntityInfoKs;
|
|
|
|
|
|
|
|
import com.ssf.mysqloracletest.domain.TransitUserRecord;
|
|
|
|
|
|
|
|
import com.ssf.mysqloracletest.domain.TransitVehicleRecord;
|
|
|
|
import com.ssf.mysqloracletest.domain.TransitVehicleRecord;
|
|
|
|
|
|
|
|
import com.ssf.mysqloracletest.service.BoneVehicleService;
|
|
|
|
import com.ssf.mysqloracletest.service.TMotorvehicleService;
|
|
|
|
import com.ssf.mysqloracletest.service.TMotorvehicleService;
|
|
|
|
import com.ssf.mysqloracletest.service.TransitVehicleRecordService;
|
|
|
|
import com.ssf.mysqloracletest.service.TransitVehicleRecordService;
|
|
|
|
import com.ssf.mysqloracletest.utils.ConfigParam;
|
|
|
|
import com.ssf.mysqloracletest.utils.ConfigParam;
|
|
|
|
import com.ssf.mysqloracletest.utils.StringKit;
|
|
|
|
import com.ssf.mysqloracletest.utils.StringKit;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import org.checkerframework.checker.units.qual.C;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
@ -34,8 +33,10 @@ public class TMotorvehicleTask {
|
|
|
|
|
|
|
|
|
|
|
|
private final TransitVehicleRecordService vehicleRecordService;
|
|
|
|
private final TransitVehicleRecordService vehicleRecordService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final BoneVehicleService boneVehicleService;
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
String maxTime = "20231225000000";
|
|
|
|
String maxTime = "20231226000000";
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(initialDelay = 100, fixedDelay = 3000)
|
|
|
|
@Scheduled(initialDelay = 100, fixedDelay = 3000)
|
|
|
|
public void setVehicleRecordService() {
|
|
|
|
public void setVehicleRecordService() {
|
|
|
@ -60,19 +61,24 @@ public class TMotorvehicleTask {
|
|
|
|
calendar.setTime(maxDate);
|
|
|
|
calendar.setTime(maxDate);
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH, 2);
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH, 2);
|
|
|
|
Date twoDaysAgo = calendar.getTime();
|
|
|
|
Date twoDaysAgo = calendar.getTime();
|
|
|
|
|
|
|
|
String format = dateFormat.format(twoDaysAgo);
|
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<TMotorvehicle> Wrapper = Wrappers.lambdaQuery();
|
|
|
|
LambdaQueryWrapper<TMotorvehicle> Wrapper = Wrappers.lambdaQuery();
|
|
|
|
Wrapper.gt(TMotorvehicle::getPasstime, maxTime);
|
|
|
|
Wrapper.gt(TMotorvehicle::getPasstime, maxTime);
|
|
|
|
Wrapper.le(TMotorvehicle::getPasstime, twoDaysAgo);
|
|
|
|
Wrapper.le(TMotorvehicle::getPasstime, format);
|
|
|
|
int countTM = tMotorvehicleService.count(Wrapper);
|
|
|
|
int countTM = tMotorvehicleService.count(Wrapper);
|
|
|
|
if (countTM > 0) {
|
|
|
|
if (countTM > 0) {
|
|
|
|
int count = countTM / 1000;
|
|
|
|
int count = countTM / 1000;
|
|
|
|
|
|
|
|
Page<TMotorvehicle> page = new Page<>( 1, 1000);
|
|
|
|
for (int i = 0; i <= count; i++) {
|
|
|
|
for (int i = 0; i <= count; i++) {
|
|
|
|
Page<TMotorvehicle> page = new Page<>(i + 1, 1000);
|
|
|
|
page.setCurrent(i + 1);
|
|
|
|
List<TMotorvehicle> resultList = tMotorvehicleService.page(page, Wrapper).getRecords();
|
|
|
|
List<TMotorvehicle> resultList = tMotorvehicleService.page(page, Wrapper).getRecords();
|
|
|
|
for (TMotorvehicle Tmvehicle : resultList) {
|
|
|
|
for (TMotorvehicle Tmvehicle : resultList) {
|
|
|
|
TransitVehicleRecord vehicleRecord = new TransitVehicleRecord();
|
|
|
|
TransitVehicleRecord vehicleRecord = new TransitVehicleRecord();
|
|
|
|
|
|
|
|
BoneVehicle one2 = boneVehicleService.lambdaQuery().eq(BoneVehicle::getNo, Tmvehicle.getPlateno()).one();
|
|
|
|
|
|
|
|
if (one2 != null){
|
|
|
|
|
|
|
|
vehicleRecord.setOwnerName(one2.getOwnerPersonName());
|
|
|
|
|
|
|
|
vehicleRecord.setIdCard(one2.getOwnerPersonIdcard());
|
|
|
|
|
|
|
|
}
|
|
|
|
vehicleRecord.setDoorwayCode(Tmvehicle.getTollgateid());
|
|
|
|
vehicleRecord.setDoorwayCode(Tmvehicle.getTollgateid());
|
|
|
|
vehicleRecord.setGbsChannelNo(Tmvehicle.getDeviceid());
|
|
|
|
vehicleRecord.setGbsChannelNo(Tmvehicle.getDeviceid());
|
|
|
|
vehicleRecord.setGlobalPic(Tmvehicle.getStorageurl1());
|
|
|
|
vehicleRecord.setGlobalPic(Tmvehicle.getStorageurl1());
|
|
|
|