|
|
@ -2,6 +2,7 @@ package com.xydl.cac.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.util.StringUtils;
|
|
|
|
import com.alibaba.excel.util.StringUtils;
|
|
|
|
import com.xydl.cac.entity.*;
|
|
|
|
import com.xydl.cac.entity.*;
|
|
|
|
|
|
|
|
import com.xydl.cac.exception.BusinessException;
|
|
|
|
import com.xydl.cac.repository.*;
|
|
|
|
import com.xydl.cac.repository.*;
|
|
|
|
import com.xydl.cac.service.I2syncService;
|
|
|
|
import com.xydl.cac.service.I2syncService;
|
|
|
|
import com.xydl.cac.service.ModevTypeService;
|
|
|
|
import com.xydl.cac.service.ModevTypeService;
|
|
|
@ -14,6 +15,7 @@ import javax.annotation.Resource;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
@ -28,6 +30,10 @@ public class I2syncServiceImpl implements I2syncService {
|
|
|
|
I2syncFieldRepository syncFieldRepository;
|
|
|
|
I2syncFieldRepository syncFieldRepository;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
I2syncConfigRepository configRepository;
|
|
|
|
I2syncConfigRepository configRepository;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
I2syncRecordRepository recordRepository;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
NSensorRepository sensorRepository;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<ModevType> listFieldConfig() {
|
|
|
|
public List<ModevType> listFieldConfig() {
|
|
|
@ -93,4 +99,16 @@ public class I2syncServiceImpl implements I2syncService {
|
|
|
|
configRepository.deleteById(id);
|
|
|
|
configRepository.deleteById(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<I2syncRecord> listRecord(Integer modevtypeId) {
|
|
|
|
|
|
|
|
List<I2syncRecord> list = recordRepository.findByModevtypeId(modevtypeId);
|
|
|
|
|
|
|
|
for (I2syncRecord record : list) {
|
|
|
|
|
|
|
|
List<NSensor> sensorList = sensorRepository.findByDevId(record.getEqmid());
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(sensorList)) {
|
|
|
|
|
|
|
|
record.setSensor(sensorList.get(0));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|