Commit 9169df1e authored by 赵啸非's avatar 赵啸非

添加样表设备列表

parent 121233cd
...@@ -54,7 +54,7 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -54,7 +54,7 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
sitePdu.setId(1L); sitePdu.setId(1L);
Rest<List<SitePdu>> siteRest = siteFeign.getFlatSitesBySiteId(sitePdu); Rest<List<SitePdu>> siteRest = siteFeign.getFlatSitesBySiteId(sitePdu);
if (siteRest.getCode() == YesNoEnum.YES.getValue()) { if (siteRest.getCode() == YesNoEnum.YES.getValue()) {
log.info("总数量:{}", siteRest.getData().size()); log.info("站点总数量:{}", siteRest.getData().size());
siteRest.getData().forEach(site -> { siteRest.getData().forEach(site -> {
DevicePdu devicePdu = new DevicePdu(); DevicePdu devicePdu = new DevicePdu();
devicePdu.setProductCode("ybj"); devicePdu.setProductCode("ybj");
...@@ -62,8 +62,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -62,8 +62,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
Rest<RespData<List<DevicePdu>>> deviceRest = deviceFeign.list(devicePdu); Rest<RespData<List<DevicePdu>>> deviceRest = deviceFeign.list(devicePdu);
if (YesNoEnum.YES.getValue() == deviceRest.getCode()) { if (YesNoEnum.YES.getValue() == deviceRest.getCode()) {
List<DevicePdu> devicePduList = deviceRest.getData().getData(); List<DevicePdu> devicePduList = deviceRest.getData().getData();
log.info("样表机总数量:{}", devicePduList.size());
if (!ObjectUtils.isEmpty(devicePduList)) { if (!ObjectUtils.isEmpty(devicePduList)) {
List<DeviceEntity> newDeviceList = devicePduList.stream().map(newDevice -> { List<DeviceEntity> newDeviceList = devicePduList.stream().map(newDevice -> {
DeviceEntity deviceEntity = new DeviceEntity(); DeviceEntity deviceEntity = new DeviceEntity();
deviceEntity.initAttrValue(); deviceEntity.initAttrValue();
...@@ -72,7 +72,6 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -72,7 +72,6 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
List<DeviceEntity> oldDeviceList = deviceService.find(new DeviceQuery().siteId(site.getId())); List<DeviceEntity> oldDeviceList = deviceService.find(new DeviceQuery().siteId(site.getId()));
Map<String, DeviceEntity> oldDeviceMap = oldDeviceList.stream().collect(Collectors.toMap(x -> x.getDeviceCode(), y -> y, (o, n) -> n)); Map<String, DeviceEntity> oldDeviceMap = oldDeviceList.stream().collect(Collectors.toMap(x -> x.getDeviceCode(), y -> y, (o, n) -> n));
List<DeviceEntity> updateDeviceLsit = newDeviceList.stream().map(item -> { List<DeviceEntity> updateDeviceLsit = newDeviceList.stream().map(item -> {
if (oldDeviceMap.containsKey(item.getDeviceCode())) { if (oldDeviceMap.containsKey(item.getDeviceCode())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment