| | |
| | | package com.qianwen.mdc.collect.handler; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | |
| | | import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType; |
| | | import org.apache.iotdb.tsfile.write.record.Tablet; |
| | | import org.apache.iotdb.tsfile.write.schema.MeasurementSchema; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.qianwen.mdc.collect.cache.WorkstationCache; |
| | | import com.qianwen.mdc.collect.config.IotDBSessionConfig; |
| | | import com.qianwen.mdc.collect.constants.IOTDBConstant; |
| | | import com.qianwen.mdc.collect.dto.PackedTelemetryData; |
| | | import com.qianwen.mdc.collect.entity.iotdb.DeviceState; |
| | | import com.qianwen.mdc.collect.entity.mgr.GlobalWcsOfRps; |
| | | import com.qianwen.mdc.collect.enums.FeedbackTimePointEnum; |
| | | import com.qianwen.mdc.collect.service.DeviceStateService; |
| | | import com.qianwen.mdc.collect.service.IotDBCommonService; |
| | | |
| | | @Component |
| | | public class DeviceStatusDataHandler implements TelemetryDataHandler { |
| | | private static final Logger log = LoggerFactory.getLogger(DeviceStatusDataHandler.class); |
| | | @Autowired |
| | | private WorkstationCache workstationCache; |
| | | @Autowired |
| | | private IotDBSessionConfig iotdbCfg; |
| | | @Autowired |
| | | private IotDBCommonService iotDBCommonService; |
| | | //@Autowired |
| | | //private IotDBSessionConfig iotdbCfg; |
| | | //@Autowired |
| | | //private IotDBCommonService iotDBCommonService; |
| | | @Autowired |
| | | private DeviceStateService deviceStateService; |
| | | @Override |
| | |
| | | state.setIsFixPoint(false); |
| | | state.setIsSync(false); |
| | | state.setIsDeleted(false); |
| | | //state.setEmployeeId(WorkstationCache.getBelongToEmployeeForWorkstation(entity.getWorkstationId(), new Date(entity.getTs().longValue()))); |
| | | |
| | | state.setEmployeeId(workstationCache.getBelongToEmployeeForWorkstation(data.getWorkstationId(), new Date(data.getTime()))); |
| | | |
| | | state.setFeedbackPointType(FeedbackTimePointEnum.NO_FEED_BACK_POINT.getValue()); |
| | | //WorkstationState propertyData = (WorkstationState) Objects.requireNonNull(BeanUtil.copy(entity, WorkstationState.class)); |
| | | state.setValueCollect(Integer.valueOf(data.getValue())); |