| | |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.LocStsType; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.enums.StationTypeEnum; |
| | | import com.vincent.rsf.server.manager.enums.TaskType; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.DeviceSiteServiceImpl; |
| | | import com.vincent.rsf.server.manager.utils.LocManageUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private BasContainerService basContainerService; |
| | | @Autowired |
| | | private DeviceSiteServiceImpl deviceSiteService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | return R.error("条码未找到对应规则"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean AGVBindAndInTaskStart(String barcode, String sta) { |
| | | //验证条码 |
| | | checkStaStatus(barcode,sta); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | String targetLoc = LocManageUtil.getTargetLoc(Long.parseLong(area)); |
| | | |
| | | taskService.generateAGVTasks(waitPakin, targetLoc, sta, loginUserId); |
| | | DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | .eq(DeviceSite::getSite, sta) |
| | | .eq(DeviceSite::getAreaIdEnd, Long.parseLong(area)) |
| | | .eq(DeviceSite::getType, TaskType.TASK_TYPE_IN.type).last("limit 1")); |
| | | if (Cools.isEmpty(deviceSite)) { |
| | | throw new CoolException("无可用路径!!"); |
| | | } |
| | | |
| | | taskService.generateAGVTasks(waitPakin, targetLoc, sta, deviceSite.getTarget(),loginUserId); |
| | | |
| | | basStation.setUseStatus(LocStsType.LOC_STS_TYPE_R.type); |
| | | if (!basStationService.updateById(basStation)) { |
| | |
| | | throw new CoolException("容器码不能为空"); |
| | | } |
| | | if (Cools.isEmpty(sta)) { |
| | | throw new CoolException("接驳位条码不能为空"); |
| | | throw new CoolException("站点信息不能为空"); |
| | | } |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, barcode) |
| | | .eq(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_DONE.val) |
| | | ); |
| | | if (Cools.isEmpty(waitPakin)) { |
| | | throw new CoolException("容器码未找到组托信息,请检查组托状态"); |
| | | } |
| | | |
| | | BasStation isBarcodeSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getBarcode, barcode) |
| | | , false |
| | |
| | | ); |
| | | if (Cools.isEmpty(basStation)) { |
| | | throw new CoolException("未找到站点信息"); |
| | | } |
| | | if (!basStation.getUseStatus().equals("O")) { |
| | | throw new CoolException("站点状态不为空闲"); |
| | | } |
| | | if (!Cools.isEmpty(basStation.getContainerType())) { |
| | | List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class); |
| | |
| | | break; // 找到匹配的就退出循环 |
| | | } |
| | | } |
| | | // boolean matches = containers.stream() |
| | | // .map(BasContainer::getCodeType) |
| | | // .anyMatch(codeType -> barcode.matches(codeType)); |
| | | if (!matches) { |
| | | throw new CoolException("条码与站点不匹配"); |
| | | } |
| | |
| | | if (!basStation.getUseStatus().equals("O")) { |
| | | throw new CoolException("站点状态不为空闲"); |
| | | } |
| | | if (basStation.getType()==0) { |
| | | if (basStation.getType().equals(StationTypeEnum.STATION_TYPE_MUTI.type)) { |
| | | throw new CoolException("站点为光电站点,禁止呼叫AGV"); |
| | | } |
| | | |