Selaa lähdekoodia

运行记录优化

yuanchao 1 kuukausi sitten
vanhempi
commit
758ba66321

+ 3 - 4
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotopeationfill/IotOpeationFillController.java

@@ -303,16 +303,15 @@ public class IotOpeationFillController {
         Timestamp endTime = Timestamp.valueOf(end);
 
 
-        boolean exists = allDevice.stream()
-                .anyMatch(yfDeviceDO -> yfDeviceDO.getSerialNumber().equals(vo.getDeviceCode()));
-
+        List<YfDeviceDO> existList = allDevice.stream().filter(e->e.getStatus()==3).collect(Collectors.toList());
+        boolean exists1 = existList.stream().anyMatch(yfDeviceDO->yfDeviceDO.getSerialNumber().equals(vo.getDeviceCode()));
 
         IotDeviceRunLogDO logDO1 = new IotDeviceRunLogDO();
         logDO1.setDeviceId(vo.getDeviceId());
         LocalTime local = LocalTime.of(12, 0);
         logDO1.setCreateTime(LocalDateTime.of(vo.getCreateTime(),local));
 
-        if(exists){
+        if(exists1){
             for (IotModelTemplateAttrsDO attrsDO:list) {
 
                 DeviceVO dv= new DeviceVO();