车辆档案数据

develop
hanrenchun 10 months ago
parent d57a26ab20
commit 041c9fc107

@ -0,0 +1,34 @@
package com.ssf.mysqloracletest.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @TableName bone_vehicle
*/
@TableName(value ="bone_vehicle")
@Data
public class BoneVehicle implements Serializable {
private Long id;
@TableField(value = "no")
private String no;
@TableField(value = "owner_person_name")
private String ownerPersonName;
@TableField(value = "owner_person_idcard")
private String ownerPersonIdcard;
@TableField(value = "owner_person_phone")
private String ownerPersonPhone;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,23 @@
package com.ssf.mysqloracletest.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ssf.mysqloracletest.domain.BoneVehicle;
import org.apache.ibatis.annotations.Mapper;
/**
* @author 28758
* @description bone_vehicle( )Mapper
* @createDate 2023-12-26 21:35:05
* @Entity generator.domain.BoneVehicle
*/
@Mapper
public interface BoneVehicleMapper extends BaseMapper<BoneVehicle> {
}

@ -0,0 +1,14 @@
package com.ssf.mysqloracletest.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ssf.mysqloracletest.domain.BoneVehicle;
/**
* @author 28758
* @description bone_vehicle( )Service
* @createDate 2023-12-26 21:35:05
*/
public interface BoneVehicleService extends IService<BoneVehicle> {
}

@ -0,0 +1,26 @@
package com.ssf.mysqloracletest.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ssf.mysqloracletest.domain.BoneVehicle;
import com.ssf.mysqloracletest.mapper.BoneVehicleMapper;
import com.ssf.mysqloracletest.service.BoneVehicleService;
import org.springframework.stereotype.Service;
/**
* @author 28758
* @description bone_vehicle( )Service
* @createDate 2023-12-26 21:35:05
*/
@Service
@DS("mysql")
public class BoneVehicleServiceImpl extends ServiceImpl<BoneVehicleMapper, BoneVehicle>
implements BoneVehicleService {
}

@ -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());

@ -1,6 +1,7 @@
package com.ssf.mysqloracletest.task; package com.ssf.mysqloracletest.task;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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;
@ -9,6 +10,7 @@ import com.ssf.mysqloracletest.domain.TransitUserRecord;
import com.ssf.mysqloracletest.service.TStrhEntityInfoKsService; import com.ssf.mysqloracletest.service.TStrhEntityInfoKsService;
import com.ssf.mysqloracletest.service.TransitUserRecordService; import com.ssf.mysqloracletest.service.TransitUserRecordService;
import com.ssf.mysqloracletest.utils.ConfigParam; import com.ssf.mysqloracletest.utils.ConfigParam;
import com.ssf.mysqloracletest.utils.NumKit;
import com.ssf.mysqloracletest.utils.StringKit; import com.ssf.mysqloracletest.utils.StringKit;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -21,6 +23,9 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/** /**
@ -51,8 +56,10 @@ public class TStrhEntityInfoKsTask {
queryWrapper.orderByDesc(TransitUserRecord::getPartitionField); queryWrapper.orderByDesc(TransitUserRecord::getPartitionField);
queryWrapper.last("LIMIT 1"); queryWrapper.last("LIMIT 1");
TransitUserRecord one = transitUserRecordService.getOne(queryWrapper); TransitUserRecord one = transitUserRecordService.getOne(queryWrapper);
if (one != null){
Date partitionField = one.getPartitionField(); Date partitionField = one.getPartitionField();
maxTime = dateFormat.format(partitionField); maxTime = dateFormat.format(partitionField);
}
//将maxTime转换为Date对象 //将maxTime转换为Date对象

@ -60,5 +60,8 @@ public class ConfigParam {
public static String wsDownloadPicAreaStart = PropertiesUtil.queryPropertiesByKey("wsDownloadPicAreaStart"); public static String wsDownloadPicAreaStart = PropertiesUtil.queryPropertiesByKey("wsDownloadPicAreaStart");
public static String TStrhEntityInfoSwitch = StringKit.toString(PropertiesUtil.queryPropertiesByKey("TStrhEntityInfoSwitch")); public static String TStrhEntityInfoSwitch = StringKit.toString(PropertiesUtil.queryPropertiesByKey("TStrhEntityInfoSwitch"));
public static String DeleteOldSwitch = StringKit.toString(PropertiesUtil.queryPropertiesByKey("DeleteOldSwitch"));
public static String TMotorvehicleSwitch = StringKit.toString(PropertiesUtil.queryPropertiesByKey("TMotorvehicleSwitch"));
public static String DeleteOldVehicleSwtich = StringKit.toString(PropertiesUtil.queryPropertiesByKey("DeleteOldVehicleSwtich"));
} }

Loading…
Cancel
Save