1、gxjs补推送断点
This commit is contained in:
parent
15b4cbbe3e
commit
e852b7c640
@ -37,17 +37,17 @@ public class Forwarder {
|
|||||||
static boolean isFwdTableInit = true;//false;
|
static boolean isFwdTableInit = true;//false;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private GnssDeviceMapper deviceMapper;
|
GnssDeviceMapper deviceMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private GnssCalcDataMapper gnssDataMapper;
|
GnssCalcDataMapper gnssDataMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FwdRecordMapper fwdRecordsMapper;
|
FwdRecordMapper fwdRecordsMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResendRecordMapper resendRecordMapper;
|
ResendRecordMapper resendRecordMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private GnssStatusMapper gnssStatusMapper;
|
GnssStatusMapper gnssStatusMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
GnssGroupFwdMapper fwdMapper;
|
GnssGroupFwdMapper fwdMapper;
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package com.imdroid.beidou_fwd.task;
|
package com.imdroid.beidou_fwd.task;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.imdroid.beidou_fwd.service.TCPClient;
|
import com.imdroid.beidou_fwd.service.TCPClient;
|
||||||
|
import com.imdroid.secapi.dto.ResendRecord;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
@ -8,6 +11,8 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Configuration
|
@Configuration
|
||||||
@ -43,6 +48,28 @@ public class GXJSForwarder extends GXXfzForwarder{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void forwardHistoryGnss(){
|
void forwardHistoryGnss(){
|
||||||
|
// 1.从转发记录表里检索待补传记录时间表,含设备Id,时间段
|
||||||
|
QueryWrapper<ResendRecord> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("fwd_group_id",fwdGroupId);
|
||||||
|
queryWrapper.eq("state",ResendRecord.STATE_BREAK_POINT);
|
||||||
|
queryWrapper.ge("createtime", LocalDateTime.now().minusDays(30));
|
||||||
|
List<ResendRecord> resendRecordsList = resendRecordMapper.selectList(queryWrapper);
|
||||||
|
|
||||||
|
if(resendRecordsList!=null && resendRecordsList.size()>0){
|
||||||
|
//修改状态
|
||||||
|
UpdateWrapper<ResendRecord> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("fwd_group_id",fwdGroupId);
|
||||||
|
updateWrapper.eq("state",ResendRecord.STATE_BREAK_POINT);
|
||||||
|
updateWrapper.ge("createtime", LocalDateTime.now().minusDays(30));
|
||||||
|
updateWrapper.set("state",ResendRecord.STATE_FWDING);
|
||||||
|
int updateNum = resendRecordMapper.update(null, updateWrapper);
|
||||||
|
logger.debug("{} forward history records: {}, update {}",fwdGroupId, resendRecordsList.size(),updateNum);
|
||||||
|
// 2.检索这个这个时间段的解算结果,如果有数据则单个终端转发,标志记录为已补传
|
||||||
|
for(ResendRecord record:resendRecordsList){
|
||||||
|
if(record.getProjectid()!=null)
|
||||||
|
logger.debug("{} forward history {}",fwdGroupId, record.getProjectid());
|
||||||
|
forwardBatchGnssRecords(record);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user