|
@@ -25,6 +25,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.net.UnknownHostException;
|
|
|
import java.time.Instant;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.Executors;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -337,6 +338,8 @@ public class OpcDAClient {
|
|
|
log.info("获取分组的数据数量:" + items.length);
|
|
|
Map<Item, ItemState> resultMap = group.read(true, items);
|
|
|
//log.info("数据获取完成。数量:", resultMap.size() + ", 组序号:" + i);
|
|
|
+ LocalDateTime time = LocalDateTime.now();
|
|
|
+ String timeStr = DateUtils.dateToString(time);
|
|
|
Instant now = Instant.now();
|
|
|
for (Item item : resultMap.keySet()) {
|
|
|
RemoteOpcVO result = new RemoteOpcVO();
|
|
@@ -345,7 +348,8 @@ public class OpcDAClient {
|
|
|
result.setPositionNum(item.getId());
|
|
|
result.setResult(new BigDecimal(value));
|
|
|
result.setTestInstant(now);
|
|
|
- // log.info("id: " + item.getId() + ", value: " + value + ", timestamp: " + itemMap.getTimestamp());
|
|
|
+ result.setTime(timeStr);
|
|
|
+ log.info("id: " + item.getId() + ", value: " + value + ", timestamp: " + itemMap.getTimestamp());
|
|
|
resultList.add(result);
|
|
|
}
|
|
|
} catch (Exception e) {
|