#
luxiaotao1123
11 小时以前 a252015c33d2c086b11ca13216c06077eae7231a
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/StaServiceImpl.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.acs.common.utils.News;
import com.zy.acs.framework.common.Cools;
import com.zy.acs.manager.common.exception.BusinessException;
import com.zy.acs.manager.core.integrate.conveyor.ConveyorStationService;
import com.zy.acs.manager.core.domain.TaskPosDto;
import com.zy.acs.manager.manager.entity.*;
@@ -52,6 +53,22 @@
        List<Sta> list = this.list(new LambdaQueryWrapper<Sta>()
                .eq(Sta::getCode, codeId).eq(Sta::getStaType, type.val()).eq(Sta::getStatus, StatusType.ENABLE.val));
        return list.stream().findFirst().orElse(null);
    }
    @Override
    public Sta selectByWorkCode(Long codeId, StaTypeType type, Long agvId) {
        if (Cools.isEmpty(codeId, type)) {
            return null;
        }
        LambdaQueryWrapper<Sta> wrapper = new LambdaQueryWrapper<Sta>()
                .eq(Sta::getStaType, type.val())
                .eq(Sta::getStatus, StatusType.ENABLE.val);
        if (agvId != null && Boolean.TRUE.equals(agvModelService.isUnderdriveAgv(agvId))) {
            wrapper.eq(Sta::getLatentCode, codeId);
        } else {
            wrapper.eq(Sta::getCode, codeId);
        }
        return this.list(wrapper).stream().findFirst().orElse(null);
    }
    @Override
@@ -117,9 +134,10 @@
        if (sta == null) {
            return null;
        }
        if (agvId != null
                && Boolean.TRUE.equals(agvModelService.isUnderdriveAgv(agvId))
                && sta.getLatentCode() != null) {
        if (agvId != null && Boolean.TRUE.equals(agvModelService.isUnderdriveAgv(agvId))) {
            if (sta.getLatentCode() == null) {
                throw new BusinessException("站点【" + sta.getStaNo() + "】未配置潜伏码");
            }
            return sta.getLatentCode();
        }
        return sta.getCode();