增加gps定时任务
This commit is contained in:
parent
17892dc637
commit
cfad1700bc
|
|
@ -81,6 +81,20 @@ public class SurvVehicleInfo extends Model<SurvVehicleInfo> {
|
||||||
@TableField("VE_DES")
|
@TableField("VE_DES")
|
||||||
private String veDes;
|
private String veDes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆经度
|
||||||
|
*/
|
||||||
|
@TableField("VE_LONG")
|
||||||
|
private String veLong;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆纬度
|
||||||
|
*/
|
||||||
|
@TableField("VE_LAT")
|
||||||
|
private String veLat;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆状态;1=可用,0=暂停
|
* 车辆状态;1=可用,0=暂停
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,14 @@ package com.lanhai.util;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.lanhai.entity.SurvConfig;
|
import com.lanhai.entity.*;
|
||||||
import com.lanhai.entity.SurvDeviceDeploy;
|
|
||||||
import com.lanhai.entity.SurvGpsInfo;
|
|
||||||
import com.lanhai.entity.SurvGpsRecord;
|
|
||||||
import com.lanhai.o.iot.szdx.ResultDeviceData;
|
import com.lanhai.o.iot.szdx.ResultDeviceData;
|
||||||
import com.lanhai.o.iot.szdx.ResultDeviceDataKeys;
|
import com.lanhai.o.iot.szdx.ResultDeviceDataKeys;
|
||||||
import com.lanhai.o.vo.HttpResponseVo;
|
import com.lanhai.o.vo.HttpResponseVo;
|
||||||
import com.lanhai.o.vo.VOIotAccess;
|
import com.lanhai.o.vo.VOIotAccess;
|
||||||
import com.lanhai.service.ISurvGpsRecordService;
|
import com.lanhai.service.ISurvGpsRecordService;
|
||||||
import com.lanhai.service.ISurvSurvConfigService;
|
import com.lanhai.service.ISurvSurvConfigService;
|
||||||
|
import com.lanhai.service.ISurvVehicleInfoService;
|
||||||
import com.xxl.job.core.context.XxlJobHelper;
|
import com.xxl.job.core.context.XxlJobHelper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
@ -52,6 +50,8 @@ public class SzDxUtils {
|
||||||
private static final RedisTemplate<String, String> redisTemplate = SpringContextUtil.getBean(StringRedisTemplate.class);
|
private static final RedisTemplate<String, String> redisTemplate = SpringContextUtil.getBean(StringRedisTemplate.class);
|
||||||
private static final ISurvSurvConfigService configService = SpringContextUtil.getBean(ISurvSurvConfigService.class);
|
private static final ISurvSurvConfigService configService = SpringContextUtil.getBean(ISurvSurvConfigService.class);
|
||||||
private static final ISurvGpsRecordService gpsRecordService = SpringContextUtil.getBean(ISurvGpsRecordService.class);
|
private static final ISurvGpsRecordService gpsRecordService = SpringContextUtil.getBean(ISurvGpsRecordService.class);
|
||||||
|
private static final ISurvVehicleInfoService vehicleInfoService = SpringContextUtil.getBean(ISurvVehicleInfoService.class);
|
||||||
|
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// 公开方法
|
// 公开方法
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
@ -308,6 +308,14 @@ public class SzDxUtils {
|
||||||
if(checks==0){
|
if(checks==0){
|
||||||
gpsRecordService.save(gpsRecord);
|
gpsRecordService.save(gpsRecord);
|
||||||
isSuccess = true;
|
isSuccess = true;
|
||||||
|
//更新车辆信息表
|
||||||
|
boolean b = vehicleInfoService.lambdaUpdate()
|
||||||
|
.set(SurvVehicleInfo::getVeLong,gpsRecord.getJingdu())
|
||||||
|
.set(SurvVehicleInfo::getVeLat,gpsRecord.getWeidu())
|
||||||
|
.eq(SurvVehicleInfo::getId,gpsRecord.getGpsId())
|
||||||
|
.update();
|
||||||
|
log.warn("xxxx更新车辆信息:{}xxxxx",b);
|
||||||
|
XxlJobHelper.log("xxxx更新车辆信息:{}xxxxx",b);
|
||||||
}else{
|
}else{
|
||||||
log.error("==={}===设备:{}-{}==gps数据校验重复,数据id为{}====",PROVIDER_NAME,survGpsInfo.getGpsName(),survGpsInfo.getGpsCode(),gpsRecord.getDataId());
|
log.error("==={}===设备:{}-{}==gps数据校验重复,数据id为{}====",PROVIDER_NAME,survGpsInfo.getGpsName(),survGpsInfo.getGpsCode(),gpsRecord.getDataId());
|
||||||
XxlJobHelper.log("==={}===设备:{}-{}==gps数据校验重复,数据id为{}====",PROVIDER_NAME,survGpsInfo.getGpsName(),survGpsInfo.getGpsCode(),gpsRecord.getDataId());
|
XxlJobHelper.log("==={}===设备:{}-{}==gps数据校验重复,数据id为{}====",PROVIDER_NAME,survGpsInfo.getGpsName(),survGpsInfo.getGpsCode(),gpsRecord.getDataId());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: local #
|
active: prod #
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue