#
Junjie
2025-08-13 b40eab1e582d72ca2e71afb2f5604671f5193f22
src/main/java/com/zy/core/thread/RgvThread.java
@@ -9,8 +9,10 @@
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasRgv;
import com.zy.asrs.entity.BasRgvOpt;
import com.zy.asrs.entity.DeviceDataLog;
import com.zy.asrs.service.BasRgvOptService;
import com.zy.asrs.service.BasRgvService;
import com.zy.asrs.service.DeviceDataLogService;
import com.zy.common.utils.News;
import com.zy.core.RgvThread2;
import com.zy.core.cache.MessageQueue;
@@ -26,6 +28,7 @@
import lombok.extern.slf4j.Slf4j;
import java.text.MessageFormat;
import java.util.Base64;
import java.util.Date;
/**
@@ -183,6 +186,22 @@
                    }
                }
                if (System.currentTimeMillis() - rgvProtocol.getDeviceDataLog() > 1000 * 5) {
                    //采集时间超过5s,保存一次数据记录
                    //保存数据记录
                    DeviceDataLogService deviceDataLogService = SpringUtils.getBean(DeviceDataLogService.class);
                    DeviceDataLog deviceDataLog = new DeviceDataLog();
                    deviceDataLog.setOriginData(Base64.getEncoder().encodeToString(result.Content));
                    deviceDataLog.setWcsData(JSON.toJSONString(rgvProtocol));
                    deviceDataLog.setType("rgv");
                    deviceDataLog.setDeviceNo(rgvProtocol.getRgvNo());
                    deviceDataLog.setCreateTime(new Date());
                    deviceDataLogService.insert(deviceDataLog);
                    //更新采集时间
                    rgvProtocol.setDeviceDataLog(System.currentTimeMillis());
                }
                try {
                    // 根据实时信息更新数据库
                    BasRgvService basRgvService = SpringUtils.getBean(BasRgvService.class);