| | |
| | | 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.*; |
| | |
| | | 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 |
| | |
| | | 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(); |