|  |  | 
 |  |  |     @Override | 
 |  |  |     public R getStaMsgSelect(Map<String, Object> params) { | 
 |  |  |         String sta = params.get("sta").toString(); | 
 |  |  |         if (Cools.isEmpty(sta)){ | 
 |  |  |         if (Cools.isEmpty(sta)) { | 
 |  |  |             throw new CoolException("接驳位条码不能为空"); | 
 |  |  |         } | 
 |  |  |         BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() | 
 |  |  |                 .eq(BasStation::getStationName, sta) | 
 |  |  |                 .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) | 
 |  |  |         ); | 
 |  |  |         if (Cools.isEmpty(basStation)){ | 
 |  |  |         if (Cools.isEmpty(basStation)) { | 
 |  |  |             throw new CoolException("未找到接驳站点信息,请检查站点状态"); | 
 |  |  |         } | 
 |  |  |         List<Long> ids =  new ArrayList<>(); | 
 |  |  |         List<Long> ids = new ArrayList<>(); | 
 |  |  |         ids.add(basStation.getArea()); | 
 |  |  |         if (basStation.getIsCrossZone() == 1){ | 
 |  |  |         if (basStation.getIsCrossZone() == 1) { | 
 |  |  |             String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1); | 
 |  |  |             String[] parts = content.split(","); | 
 |  |  |             for (int i = 0; i < parts.length; i++) { | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public R AGVInTaskStart(Map<String, Object> params,Long loginUserId ) { | 
 |  |  |     public R AGVInTaskStart(Map<String, Object> params, Long loginUserId) { | 
 |  |  |         String sta = params.get("sta").toString(); | 
 |  |  |         String area = params.get("area").toString(); | 
 |  |  |         if (Cools.isEmpty(sta)){ | 
 |  |  |         if (Cools.isEmpty(sta)) { | 
 |  |  |             throw new CoolException("接驳位条码不能为空"); | 
 |  |  |         } | 
 |  |  |         if (Cools.isEmpty(area)){ | 
 |  |  |         if (Cools.isEmpty(area)) { | 
 |  |  |             throw new CoolException("目标库区不能为空"); | 
 |  |  |         } | 
 |  |  |         BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() | 
 |  |  |                 .eq(BasStation::getStationName, sta) | 
 |  |  |                 .eq(BasStation::getUseStatus,LocStsType.LOC_STS_TYPE_F.type) | 
 |  |  |                 .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_F.type) | 
 |  |  |         ); | 
 |  |  |         if (Cools.isEmpty(basStation)){ | 
 |  |  |         if (Cools.isEmpty(basStation)) { | 
 |  |  |             throw new CoolException("未找到接驳站点信息,请检查站点状态"); | 
 |  |  |         } | 
 |  |  |         if (Cools.isEmpty(basStation.getBarcode())){ | 
 |  |  |         if (Cools.isEmpty(basStation.getBarcode())) { | 
 |  |  |             throw new CoolException("数据错误,接驳站无条码信息"); | 
 |  |  |         } | 
 |  |  |         WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() | 
 |  |  |                 .eq(WaitPakin::getBarcode, basStation.getBarcode()) | 
 |  |  |                 .eq(WaitPakin::getIoStatus,PakinIOStatus.PAKIN_IO_STATUS_DONE.val) | 
 |  |  |                 .eq(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_DONE.val) | 
 |  |  |         ); | 
 |  |  |         if (Cools.isEmpty(waitPakin)){ | 
 |  |  |         if (Cools.isEmpty(waitPakin)) { | 
 |  |  |             throw new CoolException("未找到组托数据,请检查状态"); | 
 |  |  |         } | 
 |  |  |         String targetLoc = LocManageUtil.getTargetLoc(Long.parseLong(area)); | 
 |  |  |  | 
 |  |  |         taskService.generateAGVTasks(waitPakin,targetLoc,sta,loginUserId); | 
 |  |  |         taskService.generateAGVTasks(waitPakin, targetLoc, sta, loginUserId); | 
 |  |  |  | 
 |  |  |         basStation.setUseStatus(LocStsType.LOC_STS_TYPE_R.type); | 
 |  |  |         if (!basStationService.updateById(basStation)){ | 
 |  |  |         if (!basStationService.updateById(basStation)) { | 
 |  |  |             throw new CoolException("更新站点状态失败"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         return R.ok(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public R AGVStaUnBind(Map<String, Object> params) { | 
 |  |  |         String sta = params.get("sta").toString(); | 
 |  |  |         if (Cools.isEmpty(sta)){ | 
 |  |  |         if (Cools.isEmpty(sta)) { | 
 |  |  |             throw new CoolException("接驳位条码不能为空"); | 
 |  |  |         } | 
 |  |  |         BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() | 
 |  |  |                 .eq(BasStation::getStationName, sta) | 
 |  |  |                 .eq(BasStation::getUseStatus,LocStsType.LOC_STS_TYPE_F.type) | 
 |  |  |                 .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_F.type) | 
 |  |  |         ); | 
 |  |  |         if (Cools.isEmpty(basStation)){ | 
 |  |  |         if (Cools.isEmpty(basStation)) { | 
 |  |  |             throw new CoolException("未找到接驳站点信息,请检查站点状态"); | 
 |  |  |         } | 
 |  |  |         if (Cools.isEmpty(basStation.getBarcode())){ | 
 |  |  |         if (Cools.isEmpty(basStation.getBarcode())) { | 
 |  |  |             throw new CoolException("数据错误,接驳站无条码信息"); | 
 |  |  |         } | 
 |  |  |         WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() | 
 |  |  |                 .eq(WaitPakin::getBarcode, basStation.getBarcode()) | 
 |  |  |                 .eq(WaitPakin::getIoStatus,PakinIOStatus.PAKIN_IO_STATUS_DONE.val) | 
 |  |  |                 .eq(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_DONE.val) | 
 |  |  |         ); | 
 |  |  |         if (Cools.isEmpty(waitPakin)){ | 
 |  |  |         if (Cools.isEmpty(waitPakin)) { | 
 |  |  |             throw new CoolException("未找到组托数据,请检查状态"); | 
 |  |  |         } | 
 |  |  |         basStation.setBarcode(null); | 
 |  |  |         basStation.setUseStatus(LocStsType.LOC_STS_TYPE_O.type); | 
 |  |  |         if (!basStationService.updateById(basStation)){ | 
 |  |  |         if (!basStationService.updateById(basStation)) { | 
 |  |  |             throw new CoolException("更新站点状态失败"); | 
 |  |  |         } | 
 |  |  |         return R.ok("解绑成功"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public R getStaBindList(Map<String, Object> params) { | 
 |  |  |         String sta = params.get("sta").toString(); | 
 |  |  |         if (Cools.isEmpty(sta)){ | 
 |  |  |         if (Cools.isEmpty(sta)) { | 
 |  |  |             throw new CoolException("接驳位条码不能为空"); | 
 |  |  |         } | 
 |  |  |         BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() | 
 |  |  |                 .eq(BasStation::getStationName, sta) | 
 |  |  |                 .eq(BasStation::getUseStatus,LocStsType.LOC_STS_TYPE_F.type) | 
 |  |  |                 .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_F.type) | 
 |  |  |         ); | 
 |  |  |         if (Cools.isEmpty(basStation)){ | 
 |  |  |         if (Cools.isEmpty(basStation)) { | 
 |  |  |             throw new CoolException("未找到接驳站点信息,请检查站点状态"); | 
 |  |  |         } | 
 |  |  |         if (Cools.isEmpty(basStation.getBarcode())){ | 
 |  |  |         if (Cools.isEmpty(basStation.getBarcode())) { | 
 |  |  |             throw new CoolException("数据错误,接驳站无条码信息"); | 
 |  |  |         } | 
 |  |  |         WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() | 
 |  |  |                 .eq(WaitPakin::getBarcode, basStation.getBarcode()) | 
 |  |  |                 .eq(WaitPakin::getIoStatus,PakinIOStatus.PAKIN_IO_STATUS_DONE.val) | 
 |  |  |                 .eq(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_DONE.val) | 
 |  |  |         ); | 
 |  |  |         if (Cools.isEmpty(waitPakin)){ | 
 |  |  |         if (Cools.isEmpty(waitPakin)) { | 
 |  |  |             throw new CoolException("未找到组托数据,请检查状态"); | 
 |  |  |         } | 
 |  |  |         List<WaitPakinItem> waitPakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, waitPakin.getId())); | 
 |  |  |         if (Cools.isEmpty(waitPakinItems)){ | 
 |  |  |         if (Cools.isEmpty(waitPakinItems)) { | 
 |  |  |             throw new CoolException("数据错误,未找到组托明细"); | 
 |  |  |         } | 
 |  |  |         List<Long> ids =  new ArrayList<>(); | 
 |  |  |         List<Long> ids = new ArrayList<>(); | 
 |  |  |         ids.add(basStation.getArea()); | 
 |  |  |         if (basStation.getIsCrossZone() == 1){ | 
 |  |  |         if (basStation.getIsCrossZone() == 1) { | 
 |  |  |             String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1); | 
 |  |  |             String[] parts = content.split(","); | 
 |  |  |             for (int i = 0; i < parts.length; i++) { | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public R getAGVStaBind(Map<String, Object> params) { | 
 |  |  | 
 |  |  |         //更新站点状态 | 
 |  |  |         basStation.setUseStatus(LocStsType.LOC_STS_TYPE_F.type); | 
 |  |  |         basStation.setBarcode(barcode); | 
 |  |  |         if (!basStationService.updateById(basStation)){ | 
 |  |  |         if (!basStationService.updateById(basStation)) { | 
 |  |  |             throw new CoolException("更新站点状态失败"); | 
 |  |  |         } | 
 |  |  |         return R.ok("绑定成功"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     private BasStation checkStaStatus(String barcode, String sta){ | 
 |  |  |         if (Cools.isEmpty(barcode)){ | 
 |  |  |     private BasStation checkStaStatus(String barcode, String sta) { | 
 |  |  |         if (Cools.isEmpty(barcode)) { | 
 |  |  |             throw new CoolException("容器码不能为空"); | 
 |  |  |         } | 
 |  |  |         if (Cools.isEmpty(sta)){ | 
 |  |  |         if (Cools.isEmpty(sta)) { | 
 |  |  |             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)){ | 
 |  |  |         if (Cools.isEmpty(waitPakin)) { | 
 |  |  |             throw new CoolException("容器码未找到组托信息,请检查组托状态"); | 
 |  |  |         } | 
 |  |  |         BasStation isBarcodeSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>() | 
 |  |  |                         .eq(BasStation::getBarcode, barcode) | 
 |  |  |                 ,false | 
 |  |  |                 , false | 
 |  |  |         ); | 
 |  |  |         if (!Cools.isEmpty(isBarcodeSta)){ | 
 |  |  |             throw new CoolException("该条码已被"+isBarcodeSta.getStationName()+"站绑定"); | 
 |  |  |         if (!Cools.isEmpty(isBarcodeSta)) { | 
 |  |  |             throw new CoolException("该条码已被" + isBarcodeSta.getStationName() + "站绑定"); | 
 |  |  |         } | 
 |  |  |         BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() | 
 |  |  |                 .eq(BasStation::getStationName, sta) | 
 |  |  |         ); | 
 |  |  |         if (Cools.isEmpty(basStation)){ | 
 |  |  |         if (Cools.isEmpty(basStation)) { | 
 |  |  |             throw new CoolException("未找到站点信息"); | 
 |  |  |         } | 
 |  |  |         if (!basStation.getUseStatus().equals("O")){ | 
 |  |  |         if (!basStation.getUseStatus().equals("O")) { | 
 |  |  |             throw new CoolException("站点状态不为空闲"); | 
 |  |  |         } | 
 |  |  |         if (!Cools.isEmpty(basStation.getContainerType())){ | 
 |  |  |         if (!Cools.isEmpty(basStation.getContainerType())) { | 
 |  |  |             List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class); | 
 |  |  |             List<BasContainer> containers = basContainerService.list( | 
 |  |  |                     new LambdaQueryWrapper<BasContainer>() |