优化装置状态翻转
This commit is contained in:
@@ -122,7 +122,8 @@ public class InfluxdbPqsCommunicateImpl implements IPqsCommunicate {
|
||||
pqsCommunicate.setDevId(pqsCommunicateDto.getDevId());
|
||||
pqsCommunicate.setType(pqsCommunicateDto.getType());
|
||||
//如果不存数据或者状态不一样则插入数据
|
||||
if(CollectionUtils.isEmpty(pqsCommunicates)|| !Objects.equals( pqsCommunicates.get(0).getType(),pqsCommunicateDto.getType())){
|
||||
//可能存在掉线后最后一组数据还未入库,添加时间判断
|
||||
if(CollectionUtils.isEmpty(pqsCommunicates)|| (!Objects.equals( pqsCommunicates.get(0).getType(),pqsCommunicateDto.getType())&&pqsCommunicates.get(0).getTime().isBefore(pqsCommunicate.getTime()))){
|
||||
pqsCommunicateMapper.insertOne(pqsCommunicate);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user