增加移动距离超过某一门限后触发变周期的功能
This commit is contained in:
parent
231a672181
commit
a6c2d58461
@ -2,6 +2,7 @@ package com.imdroid.sideslope.service;
|
||||
|
||||
import com.imdroid.secapi.dto.GnssCalcData;
|
||||
import com.imdroid.sideslope.message.D341LocationMessage;
|
||||
import com.imdroid.sideslope.sal.Device;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@ -33,8 +33,8 @@ public class GNSSDeviceLocationRecordServiceImpl implements GNSSDeviceLocationRe
|
||||
@Autowired
|
||||
private GnssRawDataMapper gnssRawDataMapper;
|
||||
|
||||
@Resource(name = "local")
|
||||
private DeviceService gnssDeviceRepository;
|
||||
@Autowired
|
||||
private GnssDeviceMapper gnssDeviceRepository;
|
||||
@Autowired
|
||||
private GnssGroupCalcMapper groupCalcMapper;
|
||||
|
||||
@ -59,15 +59,15 @@ public class GNSSDeviceLocationRecordServiceImpl implements GNSSDeviceLocationRe
|
||||
@Override
|
||||
public void save(GnssCalcData locationRecord, boolean isExceed) {
|
||||
String deviceId = locationRecord.getDeviceid();
|
||||
Device gnssDevice = gnssDeviceRepository.findByDeviceId(deviceId);
|
||||
GnssDevice gnssDevice = gnssDeviceRepository.queryByDeviceId(deviceId);
|
||||
if(gnssDevice == null) return;
|
||||
|
||||
//补充解算记录的设备信息
|
||||
locationRecord.setTenantid(gnssDevice.getTenantId());
|
||||
locationRecord.setTenantid(gnssDevice.getTenantid());
|
||||
locationRecord.setEnabled(true);
|
||||
|
||||
// 获取平滑参数
|
||||
GnssGroupCalc groupCalc = getCalcParams(gnssDevice.getCalcGroupId());
|
||||
GnssGroupCalc groupCalc = getCalcParams(gnssDevice.getCalc_group_id());
|
||||
|
||||
// 计算平滑周期
|
||||
int filterCycle = groupCalc.getFilter_hour();
|
||||
@ -259,9 +259,9 @@ public class GNSSDeviceLocationRecordServiceImpl implements GNSSDeviceLocationRe
|
||||
@Override
|
||||
public LocalDateTime updateRb562(String deviceId, LocalDateTime afterTime){
|
||||
// 获取平滑参数
|
||||
Device gnssDevice = gnssDeviceRepository.findByDeviceId(deviceId);
|
||||
GnssDevice gnssDevice = gnssDeviceRepository.queryByDeviceId(deviceId);
|
||||
if(gnssDevice == null) return afterTime;
|
||||
GnssGroupCalc groupCalc = getCalcParams(gnssDevice.getCalcGroupId());
|
||||
GnssGroupCalc groupCalc = getCalcParams(gnssDevice.getCalc_group_id());
|
||||
|
||||
// 平滑处理
|
||||
LocalDateTime beforTime = afterTime.plusHours(groupCalc.getFilter_hour());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user