| | |
| | | import com.mongodb.client.result.DeleteResult; |
| | | import com.ycl.feign.UYClient; |
| | | import com.ycl.platform.domain.param.UY.*; |
| | | import com.ycl.platform.domain.result.HK.FaceDeviceInspectionResult; |
| | | import com.ycl.platform.domain.result.UY.OneMachineFileResult; |
| | | import com.ycl.platform.domain.result.UY.OsdMonitorResult; |
| | | import com.ycl.platform.domain.result.UY.RecordMetaDSumResult; |
| | | import com.ycl.platform.domain.result.UY.*; |
| | | import com.ycl.platform.service.ITMonitorService; |
| | | import com.ycl.platform.service.IYwThresholdService; |
| | | import com.ycl.platform.service.UYErrorTypeCheckService; |
| | | import com.ycl.platform.service.YwPointService; |
| | | import com.ycl.utils.DateUtils; |
| | | import constant.ApiConstants; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | //优云对接数据任务 |
| | | @Slf4j |
| | | @Component("UYTask") |
| | | @RequiredArgsConstructor |
| | | public class UYTask { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Autowired |
| | | private UYClient uyClient; |
| | | @Autowired |
| | | private IYwThresholdService ywThresholdService; |
| | | @Autowired |
| | | private ITMonitorService monitorService; |
| | | @Autowired |
| | | private UYErrorTypeCheckService uyErrorTypeCheckService; |
| | | private final MongoTemplate mongoTemplate; |
| | | private final UYClient uyClient; |
| | | private final UYErrorTypeCheckService uyErrorTypeCheckService; |
| | | private final YwPointService pointService; |
| | | |
| | | @Value("${youYun.tenantId}") |
| | | private String tenantId; |
| | |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, ImageDetectionResult.class); |
| | | records.stream().forEach(item -> { |
| | | if (Objects.nonNull(item.getDeviceId())) { |
| | | item.setNo(item.getDeviceId()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(records); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(records); |
| | | // 工单生成 |
| | |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, MonitorQualifyResult.class); |
| | | records.stream().forEach(item -> { |
| | | if (Objects.nonNull(item.getSerialNumber())) { |
| | | item.setNo(item.getSerialNumber().getShowValue()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(records); |
| | | pointService.setNew(records); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(records); |
| | | // 工单生成 |
| | |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, RecordMetaDSumResult.class); |
| | | records.stream().forEach(item -> { |
| | | if (Objects.nonNull(item.getDeviceId())) { |
| | | item.setNo(item.getDeviceId()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(records); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(records); |
| | | // 工单生成 |