#
luxiaotao1123
2024-11-13 fc5fc7ca68282cce52c240ae5b3e69e81c27bfcb
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AgvDataService.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSON;
import com.zy.acs.common.domain.AgvProtocol;
import com.zy.acs.common.domain.protocol.*;
import com.zy.acs.common.enums.AgvStatusType;
import com.zy.acs.common.utils.GsonUtils;
import com.zy.acs.common.utils.RedisSupport;
import com.zy.acs.framework.common.Cools;
@@ -132,6 +133,8 @@
    // 有码实时数据包
    private void sync(AGV_12_UP mesBody, AgvDetail detail) {
        detail.setStatus(mesBody.getStatus());
        Code code = codeService.selectByData(mesBody.getQrCode());
        if (null != code) {
            detail.setCode(code.getId());
@@ -143,8 +146,6 @@
        } else {
            log.error("Agv [{}] 更新定位数据失败 !!!上传条码:{}", agvService.getById(detail.getAgvId()).getUuid(), mesBody.getQrCode());
        }
        detail.setStatus(mesBody.getStatus());
        // 地面码偏移
        detail.setCodeOffsert(JSON.toJSONString(Cools
@@ -180,14 +181,22 @@
    // 无码实时数据包
    private void sync(AGV_13_UP mesBody, AgvDetail detail) {
        detail.setStatus(mesBody.getStatus());
        Code code = codeService.selectByData(mesBody.getQrCode());
        if (null != code) {
            if (!detail.getAgvStatus().equals(AgvStatusType.CHARGE)) {
            detail.setCode(null);
            detail.setLastCode(code.getId());
            detail.setPos(0);
//            if (!agvDetailService.updateUnPosCode(detail.getId(), code.getId())) {
//                log.error("Agv [{}] 更新定位数据失败 !!!", agvService.getById(detail.getAgvId()).getUuid());
//            }
            } else {
                detail.setCode(code.getId());
                detail.setLastCode(null);
                detail.setPos(1);
            }
        } else {
            log.error("Agv [{}] 更新定位数据失败 !!!上传条码:{}", agvService.getById(detail.getAgvId()).getUuid(), mesBody.getQrCode());
        }