yangys
2024-08-28 588c386e318c05ef406d68335432a3fd1d97a107
状态打固定点1
已修改6个文件
已添加1个文件
260 ■■■■■ 文件已修改
collect/src/main/java/com/qianwen/mdc/collect/handler/DeviceStatusDataHandler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
collect/src/main/java/com/qianwen/mdc/collect/service/CollectDataService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
collect/src/main/java/com/qianwen/mdc/collect/service/DeviceStateFixPointService.java 228 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
collect/src/main/java/com/qianwen/mdc/collect/service/IotDBCommonService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
collect/src/main/java/com/qianwen/mdc/collect/service/OutputAggregateService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
collect/src/main/java/com/qianwen/mdc/collect/service/PackedDataService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
collect/src/test/java/com/qianwen/mdc/collect/service/DeviceStateFixPointServiceTest.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
collect/src/main/java/com/qianwen/mdc/collect/handler/DeviceStatusDataHandler.java
@@ -68,7 +68,7 @@
    void insertState(DeviceState state){
        String deviceId = IOTDBConstant.DB_PREFIX+IOTDBConstant.TEMPLATE_STATE+"_"+state.getWorkstationId();
        try {
            iotDBCommonService.setTemmplateIsNotSet(IOTDBConstant.TEMPLATE_STATE, deviceId);
            iotDBCommonService.setTemmplateIfNotSet(IOTDBConstant.TEMPLATE_STATE, deviceId);
            
            List<MeasurementSchema> schemas = new ArrayList<>();
            
collect/src/main/java/com/qianwen/mdc/collect/service/CollectDataService.java
@@ -53,7 +53,7 @@
        PROCESS_PARAM_MAP.put(7, "ALARM");
    }
    // TelemetryDataMessage telemetryDataMessage
    public void handleCollectData(List<TelemetryData> telemetryDataList) {
        for (TelemetryData dt : telemetryDataList) {
@@ -92,7 +92,7 @@
            
            deviceId = generateDeviceId(dt.getWorkstationId(),name);
            //System.out.println("deivcdid="+deviceId);
            iotDBCommonService.setTemmplateIsNotSet(TEMPLATE_NAME, deviceId);
            iotDBCommonService.setTemmplateIfNotSet(TEMPLATE_NAME, deviceId);
            Tablet tablet = new Tablet(deviceId, schemas);
            for(TypedTelemetryData tdata : typeList) {
                rowIndex = tablet.rowSize++;
@@ -110,7 +110,6 @@
                log.error("IOTDB入库失败",e);
                e.printStackTrace();
            }
            //System.out.println(typeList);
        }
        
collect/src/main/java/com/qianwen/mdc/collect/service/DeviceStateFixPointService.java
@@ -1,131 +1,125 @@
package com.qianwen.mdc.collect.service;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Lists;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;
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.Service;
import com.google.common.collect.Lists;
import com.qianwen.core.tool.utils.Func;
import com.qianwen.core.tool.utils.SpringUtil;
import com.qianwen.mdc.collect.cache.WorkstationCache;
import com.qianwen.mdc.collect.config.IotDBSessionConfig;
import com.qianwen.mdc.collect.constants.CommonConstant;
import com.qianwen.mdc.collect.constants.IOTDBConstant;
import com.qianwen.mdc.collect.dto.CalendarShiftInfoDTO;
import com.qianwen.mdc.collect.dto.WorkstationDTO;
import com.qianwen.mdc.collect.entity.iotdb.DeviceState;
import com.qianwen.mdc.collect.enums.FeedbackTimePointEnum;
import com.qianwen.mdc.collect.mapper.iotdb.DeviceStateMapper;
import com.qianwen.mdc.collect.mapper.mgr.CalendarMapper;
import com.qianwen.mdc.collect.utils.LocalDateTimeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
@Service
public class DeviceStateFixPointService{
    private static final Logger log = LoggerFactory.getLogger(DeviceStateFixPointService.class);
    @Autowired
    private DeviceStateMapper deviceStateMapper;
    @Autowired
    private CalendarMapper calendarMapper;
    @Autowired
    private WorkstationCache workstationCache;
    @Autowired
    private IotDBCommonService iotDBCommonService;
    @Autowired
    private IotDBSessionConfig iotdbConfig;
    /**
     * åŠ å…¥å›ºå®šç‚¹,原workStationStateFixPoint
     * @param dateTime
     * @param dateTime æ‰“固定点的日期
     * @param includeWorkstationIds
     */
    public void deviceStateFixPoint(DateTime dateTime, List<String> includeWorkstationIds) {
        List<DeviceState> result;
        //CalendarMapper calendarMapper = SpringUtil.getBean(CalendarMapper.class);
        Map<Long, WorkstationDTO> workStations = workstationCache.getWorkStations();
        if (ObjectUtil.isEmpty(workStations)) {
            return;
        }
        Collection<WorkstationDTO> values = workStations.values();
        //boolean b = ObjectUtil.isAllNotEmpty(includeWorkstationIds);//yys
        //boolean b2 = Func.isNotEmpty(includeWorkstationIds);
        if (ObjectUtil.isNotEmpty(includeWorkstationIds)) {
            /*
            values = (Collection) values.stream().filter(item -> {
                return includeWorkstationIds.contains(item.getId().toString());
            }).collect(Collectors.toList());*/
            values = values.stream().filter(item -> includeWorkstationIds.contains(item.getId().toString())).collect(Collectors.toList());
        }
        List<String> calendarCodeList = workStations.values().stream().map(WorkstationDTO::getCalendarCode).distinct().filter(Func::isNotEmpty).collect(Collectors.toList());
        /*
        List<String> calendarCodeList = (List) workStations.values().stream().map((v0) -> {
            return v0.getCalendarCode();
        }).distinct().filter((v0) -> {
            return Func.isNotEmpty(v0);
        }).collect(Collectors.toList());*/
        Map<String, List<CalendarShiftInfoDTO>> map = new HashMap<>(32);
        Map<String, List<CalendarShiftInfoDTO>> shiftMap ;
        String formatDateTime = DateUtil.formatDate(dateTime);
        if (Func.isNotEmpty(calendarCodeList)) {
            /*
            List<CalendarShiftInfoDTO> calendarShiftInfoDTOList = calendarMapper.getCalendarShiftInfo(calendarCodeList, DateUtil.year(dateTime), formatDateTime);
            map = (Map) calendarShiftInfoDTOList.stream().collect(Collectors.groupingBy((v0) -> {
                return v0.getCode();
            }));*/
            List<CalendarShiftInfoDTO> calendarShiftInfoDTOList = calendarMapper.getCalendarShiftInfo(calendarCodeList, DateUtil.year(dateTime), formatDateTime);
            map = calendarShiftInfoDTOList.stream().collect(Collectors.groupingBy(CalendarShiftInfoDTO::getCode));
            shiftMap = calendarShiftInfoDTOList.stream().collect(Collectors.groupingBy(CalendarShiftInfoDTO::getCode));
        }else {
            shiftMap = Collections.emptyMap();
        }
        List<DeviceState> res = Lists.newArrayList();
        for (WorkstationDTO workstationDTO : values) {
            
            result = Lists.newArrayList();
            List<CalendarShiftInfoDTO> list = map.getOrDefault(workstationDTO.getCalendarCode(), Collections.singletonList(new CalendarShiftInfoDTO().setCode("0").setCalendarDay(formatDateTime).setFactoryYear(Integer.valueOf(DateUtil.year(dateTime))).setFactoryWeek(LocalDateTimeUtils.getWeek(dateTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate())).setFactoryMonth(Integer.valueOf(DateUtil.month(dateTime) + 1)).setFactoryDate(formatDateTime).setStartTime(DateUtil.beginOfDay(dateTime)).setShiftIndex(CommonConstant.DEFAULT_SHIFT_INDEX).setShiftTimeType(CommonConstant.DEFAULT_SHIFT_TYPE)));
            if (map.containsKey(workstationDTO.getCalendarCode())) {
            List<CalendarShiftInfoDTO> calendarShiftList = shiftMap.getOrDefault(workstationDTO.getCalendarCode(), Collections.singletonList(new CalendarShiftInfoDTO().setCode("0").setCalendarDay(formatDateTime).setFactoryYear(Integer.valueOf(DateUtil.year(dateTime))).setFactoryWeek(LocalDateTimeUtils.getWeek(dateTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate())).setFactoryMonth(Integer.valueOf(DateUtil.month(dateTime) + 1)).setFactoryDate(formatDateTime).setStartTime(DateUtil.beginOfDay(dateTime)).setShiftIndex(CommonConstant.DEFAULT_SHIFT_INDEX).setShiftTimeType(CommonConstant.DEFAULT_SHIFT_TYPE)));
            if (shiftMap.containsKey(workstationDTO.getCalendarCode())) {
                result = getNoDefaultShift24HourPointDTOS(workstationDTO.getId(), workstationDTO.getCalendarCode(), dateTime);
            } else {
                result = getDefaultShift24HourPointDTOS(workstationDTO.getId(), workstationDTO.getCalendarCode(), list.get(0));
                result = getDefaultShift24HourPointDTOS(workstationDTO.getId(), workstationDTO.getCalendarCode(), calendarShiftList.get(0));
            }
            
            //将生产日历中的时间节点加入固定点
            for (int i = 0; i < list.size(); i++) {
            for (int i = 0; i < calendarShiftList.size(); i++) {
                //DeviceState workstationState = WorkstationStateConvert.INSTANCE.convert(list.get(i));
                CalendarShiftInfoDTO calendarShiftDTO = list.get(i);
                CalendarShiftInfoDTO calendarShiftDTO = calendarShiftList.get(i);
                
                DeviceState workstationState = new DeviceState();
                DeviceState deviceState = new DeviceState();
                
                workstationState.setIsSync(false);
                workstationState.setIsFixPoint(true);
                workstationState.setValueCollect(0);
                workstationState.setRps(0);
                workstationState.setWcs(0);
                workstationState.setWorkstationId(workstationDTO.getId());
                workstationState.setTime(Long.valueOf(calendarShiftDTO.getStartTime().getTime()));
                workstationState.setIsDeleted(Boolean.FALSE);
                workstationState.setFeedbackPointType(FeedbackTimePointEnum.NO_FEED_BACK_POINT.getValue());
                workstationState.setCalendarCode(workstationDTO.getCalendarCode());
                deviceState.setIsSync(false);
                deviceState.setIsFixPoint(true);
                deviceState.setValueCollect(0);
                deviceState.setRps(0);
                deviceState.setWcs(0);
                deviceState.setWorkstationId(workstationDTO.getId());
                deviceState.setTime(Long.valueOf(calendarShiftDTO.getStartTime().getTime()));
                deviceState.setIsDeleted(Boolean.FALSE);
                deviceState.setFeedbackPointType(FeedbackTimePointEnum.NO_FEED_BACK_POINT.getValue());
                deviceState.setCalendarCode(workstationDTO.getCalendarCode());
                
                String factoryDate = calendarShiftDTO.getFactoryDate();
                String[] split = Func.split(factoryDate, "-");
                workstationState.setFactoryDate(Integer.valueOf(String.join("", split)));
                workstationState.setFactoryYear(calendarShiftDTO.getFactoryYear());
                workstationState.setFactoryMonth(calendarShiftDTO.getFactoryMonth());
                workstationState.setFactoryWeek(calendarShiftDTO.getFactoryWeek());
                deviceState.setFactoryDate(Integer.valueOf(String.join("", split)));
                deviceState.setFactoryYear(calendarShiftDTO.getFactoryYear());
                deviceState.setFactoryMonth(calendarShiftDTO.getFactoryMonth());
                deviceState.setFactoryWeek(calendarShiftDTO.getFactoryWeek());
                
                workstationState.setShiftIndex(calendarShiftDTO.getShiftIndex());
                workstationState.setShiftTimeType(calendarShiftDTO.getShiftTimeType());
                deviceState.setShiftIndex(calendarShiftDTO.getShiftIndex());
                deviceState.setShiftTimeType(calendarShiftDTO.getShiftTimeType());
                
        
               // buildDefaultFactoryDay(dateTime, workstationState);
                buildDefaultFactoryDay(dateTime, deviceState);
                
                result.add(workstationState);
                result.add(deviceState);
            }
            res.addAll(result);
        }
@@ -140,7 +134,90 @@
    }
    
    /**
     * ä¿å­˜çŠ¶æ€å›ºå®šç‚¹æ•°æ®(state_{workstationId})
     * @param stateList
     */
    void saveDeviceStates(List<DeviceState> stateList) {
        //employees.stream().collect(Collectors.groupingBy(Employee::getCity)
        Map<Long,List<DeviceState>> maps = stateList.stream().collect(Collectors.groupingBy(DeviceState::getWorkstationId));
        List<Long> workstationIds = stateList.stream().map(DeviceState::getWorkstationId).distinct().collect(Collectors.toList());
        String deviceId;
        for(Long wid : workstationIds) {
            //创建时间序列
            deviceId = IOTDBConstant.DB_PREFIX+"state_"+wid;
            iotDBCommonService.setTemmplateIfNotSet(IOTDBConstant.TEMPLATE_STATE, deviceId);
        }
        List<MeasurementSchema> schemas = new ArrayList<>();
        schemas.add(new MeasurementSchema("workstation_id", TSDataType.INT64));
        schemas.add(new MeasurementSchema("value_collect", TSDataType.INT32));
        schemas.add(new MeasurementSchema("calendar_code", TSDataType.TEXT));
        schemas.add(new MeasurementSchema("factory_year", TSDataType.INT32));
        schemas.add(new MeasurementSchema("factory_month", TSDataType.INT32));
        schemas.add(new MeasurementSchema("factory_week", TSDataType.INT32));
        schemas.add(new MeasurementSchema("factory_date", TSDataType.INT32));
        schemas.add(new MeasurementSchema("shift_index", TSDataType.INT32));
        schemas.add(new MeasurementSchema("shift_time_type", TSDataType.INT32));
        schemas.add(new MeasurementSchema("wcs", TSDataType.INT32));
        schemas.add(new MeasurementSchema("rps", TSDataType.INT32));
        schemas.add(new MeasurementSchema("is_fix_point", TSDataType.BOOLEAN));
        schemas.add(new MeasurementSchema("is_sync", TSDataType.BOOLEAN));
        schemas.add(new MeasurementSchema("is_plan", TSDataType.INT32));//TODO è¿™ä¸ªå±žæ€§åº”该是GlobalWcsOfRps中的值,如何填写?
        schemas.add(new MeasurementSchema("feedback_point_type", TSDataType.INT32));
        schemas.add(new MeasurementSchema("feedback_id", TSDataType.INT64));
        schemas.add(new MeasurementSchema("is_deleted", TSDataType.BOOLEAN));
        schemas.add(new MeasurementSchema("employee_id", TSDataType.INT64));
        Long wid;
        List<DeviceState> states;
        for(Entry<Long, List<DeviceState>>  entry: maps.entrySet()) {
            wid = entry.getKey();
            deviceId = IOTDBConstant.DB_PREFIX+"state_"+wid;
            Tablet tablet = new Tablet(deviceId, schemas);
            states = entry.getValue();
            tablet.rowSize = states.size();
            DeviceState state;
            for(int i=0;i<states.size();i++) {
                state = states.get(i);
                tablet.addTimestamp(i, state.getTime());
                tablet.addValue("workstation_id", i, state.getWorkstationId());
                tablet.addValue("value_collect", i, state.getValueCollect());
                tablet.addValue("calendar_code", i, state.getCalendarCode());
                tablet.addValue("factory_year", i, state.getFactoryYear());
                tablet.addValue("factory_month", i, state.getFactoryMonth());
                tablet.addValue("factory_week", i, state.getFactoryWeek());
                tablet.addValue("factory_date", i, state.getFactoryDate());
                tablet.addValue("shift_index", i, state.getShiftIndex());
                tablet.addValue("shift_time_type", i, state.getShiftTimeType());
                tablet.addValue("wcs", i, state.getWcs());
                tablet.addValue("rps", i, state.getRps());
                tablet.addValue("is_fix_point", i, state.getIsFixPoint());
                tablet.addValue("is_sync", i, state.getIsSync());
                tablet.addValue("is_plan", i, state.getIsPlan());
                tablet.addValue("feedback_point_type", i, state.getFeedbackPointType());
                tablet.addValue("feedback_id", i, state.getFeedbackId());
                tablet.addValue("is_deleted", i, state.getIsDeleted());
                tablet.addValue("employee_id", i, state.getEmployeeId());
            }
            try {
                this.iotdbConfig.getSessionPool().insertAlignedTablet(tablet);
            } catch (Exception e) {
                log.error("保存固定点数据异常",e);
            }
        }
        
    }
    private List<DeviceState> getDefaultShift24HourPointDTOS(Long workStationId, String calendarCode, CalendarShiftInfoDTO shift) {
@@ -172,7 +249,6 @@
               state.setFactoryWeek(shift.getFactoryWeek());
            state.setShiftIndex(shift.getShiftIndex());
            state.setShiftTimeType(shift.getShiftTimeType());
            //workstationState.setShiftIndex(calendarShiftDTO.getShiftIndex());
            
            state.setIsDeleted(Boolean.FALSE);
            default24HourPointDTO.add(state);
@@ -180,8 +256,15 @@
        return default24HourPointDTO;
    }
    private List<DeviceState> getNoDefaultShift24HourPointDTOS(Long workStationId, String calendarCode, DateTime dateTime) {
        List<DeviceState> default24HourPointDTO = new ArrayList<>();
    /**
     * ç”Ÿæˆéžé»˜è®¤çš„24小时固定点位
     * @param worksationId å·¥ä½id
     * @param calendarCode
     * @param dateTime å›ºå®šç‚¹ç”Ÿæˆçš„æ—¥æœŸ
     * @return
     */
    private List<DeviceState> getNoDefaultShift24HourPointDTOS(Long worksationId, String calendarCode, DateTime dateTime) {
        List<DeviceState> default24HourPointDTOList = new ArrayList<>();
        CalendarMapper calendarMapper = (CalendarMapper) SpringUtil.getBean(CalendarMapper.class);
        try {
            List<CalendarShiftInfoDTO> calendarShiftList = calendarMapper.getCalendarShiftInfoToday(calendarCode, DateUtil.formatDate(dateTime));
@@ -193,26 +276,27 @@
                state.setValueCollect(0);
                state.setRps(0);
                state.setWcs(0);
                state.setWorkstationId(workStationId);
                state.setWorkstationId(worksationId);
                state.setTime(Long.valueOf(time.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()));
                state.setCalendarCode(calendarCode);
                state.setFeedbackPointType(FeedbackTimePointEnum.NO_FEED_BACK_POINT.getValue());
                state.setIsDeleted(Boolean.FALSE);
                state.setIsDeleted(false);
                
              //如果state.ts在calendarShiftList区间内,则填充班制和生产日历信息,并将state加入到default24HourPointDTO中
                packCalendarShiftInfoForTimePoint(calendarShiftList, default24HourPointDTO, state);
                //如果state.ts在calendarShiftList区间内,则填充班制和生产日历信息,并将state加入到default24HourPointDTO中
                packCalendarShiftInfoForTimePoint(calendarShiftList, default24HourPointDTOList, state);
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("生成固定点数据异常",e);
        }
        return default24HourPointDTO;
        return default24HourPointDTOList;
    }
    private void packCalendarShiftInfoForTimePoint(List<CalendarShiftInfoDTO> calendarShiftList, List<DeviceState> default24HourPointDTO, DeviceState state) {
    private void packCalendarShiftInfoForTimePoint(List<CalendarShiftInfoDTO> calendarShiftList, List<DeviceState> default24HourPointDTOList, DeviceState state) {
        if (Func.isNotEmpty(calendarShiftList)) {
            CalendarShiftInfoDTO relatedShift = calendarShiftList.stream().filter(item -> {
                return item.getStartTime().getTime() <= state.getTime().longValue() && item.getEndTime().getTime() > state.getTime().longValue();
            }).findFirst().orElse(null);
            if (Func.isNotEmpty(relatedShift)) {
                state.setShiftIndex(relatedShift.getShiftIndex());
                state.setShiftTimeType(relatedShift.getShiftTimeType());
@@ -223,13 +307,13 @@
                String[] split = Func.split(factoryDate, "-");
                state.setFactoryDate(Integer.valueOf(String.join("", split)));
                state.setIsDeleted(Boolean.FALSE);
                default24HourPointDTO.add(state);
                default24HourPointDTOList.add(state);
                return;
            }
            log.error("工位{} æ—¥åކ{} æ²¡æœ‰æ•´ç‚¹å¾—班次信息", state.getWorkstationId(), state.getCalendarCode());
            log.warn("工位{} æ—¥åކ{} æœªæ‰¾åˆ°æ•´ç‚¹ç­æ¬¡ä¿¡æ¯", state.getWorkstationId(), state.getCalendarCode());
            return;
        }
        log.error("工位{} æ—¥åކ{} æ²¡æœ‰è‡ªç„¶å¤©{}得班次信息", new Object[]{state.getWorkstationId(), state.getCalendarCode(), state.getTime()});
        log.error("工位{} æ—¥åކ{} æ— è‡ªç„¶å¤©{}班次信息", new Object[]{state.getWorkstationId(), state.getCalendarCode(), state.getTime()});
    }
    //不一定能用上
collect/src/main/java/com/qianwen/mdc/collect/service/IotDBCommonService.java
@@ -45,7 +45,7 @@
     * @param template æ¨¡æ¿åç§°
     * @param deviceId è®¾å¤‡è·¯å¾„
     */
    public void setTemmplateIsNotSet(String template,String deviceId) {
    public void setTemmplateIfNotSet(String template,String deviceId) {
        if(!isTemplateSetOnPath(template, deviceId)) {
             try {
                 iotdbCfg.getSessionPool().setSchemaTemplate(template, deviceId);
collect/src/main/java/com/qianwen/mdc/collect/service/OutputAggregateService.java
@@ -48,7 +48,7 @@
            String pathPprefix = IOTDBConstant.DB_PREFIX+IOTDBConstant.TEMPLATE_OUTPUT+"_"+workstationId;
            //this.workstationAggregateOutputMapper.createTable(workStationId);
            //this.workstationOutputMapper.createTable(workStationId);
            iotDBCommonService.setTemmplateIsNotSet(IOTDBConstant.TEMPLATE_AGGREGATEOUTPUT, pathPprefix);
            iotDBCommonService.setTemmplateIfNotSet(IOTDBConstant.TEMPLATE_AGGREGATEOUTPUT, pathPprefix);
            /*
            List<WorkstationOutput> notSyncWorkstationOutputs = this.workstationOutputMapper.selectList(Wrappers.<WorkstationOutput>lambdaQuery()
                    .eq(WorkstationOutput::getWorkstationId, workStationId)
@@ -93,10 +93,10 @@
     */
    void crateOutputTables(long workstationId){
        String aggregatePathPrefix = IOTDBConstant.DB_PREFIX+IOTDBConstant.TEMPLATE_AGGREGATEOUTPUT+"_"+workstationId;
        iotDBCommonService.setTemmplateIsNotSet(IOTDBConstant.TEMPLATE_AGGREGATEOUTPUT, aggregatePathPrefix);
        iotDBCommonService.setTemmplateIfNotSet(IOTDBConstant.TEMPLATE_AGGREGATEOUTPUT, aggregatePathPrefix);
        
        String outputPathPrefix = IOTDBConstant.DB_PREFIX+IOTDBConstant.TEMPLATE_OUTPUT+"_"+workstationId;
        iotDBCommonService.setTemmplateIsNotSet(IOTDBConstant.TEMPLATE_OUTPUT, outputPathPrefix);
        iotDBCommonService.setTemmplateIfNotSet(IOTDBConstant.TEMPLATE_OUTPUT, outputPathPrefix);
        
    }
collect/src/main/java/com/qianwen/mdc/collect/service/PackedDataService.java
@@ -137,7 +137,7 @@
        String deviceId = DB_PREFIX + TEMPLATE_NAME + "_" + dt.getWorkstationId();
        // æŒ‚载模板
        iotDBCommonService.setTemmplateIsNotSet(TEMPLATE_NAME, deviceId);
        iotDBCommonService.setTemmplateIfNotSet(TEMPLATE_NAME, deviceId);
        List<MeasurementSchema> schemas = new ArrayList<>();
collect/src/test/java/com/qianwen/mdc/collect/service/DeviceStateFixPointServiceTest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
package com.qianwen.mdc.collect.service;
import java.util.Date;
import org.junit.jupiter.api.Test;
public class DeviceStateFixPointServiceTest {
    @Test
    public void t() {
        Date dt = new Date(1724688000000L);
        System.out.println(dt);
    }
}