| | |
| | | waitPakin.setAnfme(detlDto.getAnfme()); |
| | | waitPakin.setThreeCode(detlDto.getThreeCode()); |
| | | waitPakin.setStatus("Y"); |
| | | waitPakin.setSuppCode(detlDto.getStandby1()); |
| | | waitPakin.setStandby1(detlDto.getStandby1()); |
| | | waitPakin.setStandby2(detlDto.getStandby2()); |
| | | waitPakin.setStandby3(detlDto.getStandby3()); |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R OutCallAgv(AgvCallParams params, Long userId) { |
| | | |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>() |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | .eq("dev_no", params.getTarSite())); |
| | | if (Objects.isNull(station)) { |
| | | throw new CoolException("请检查站点信息!"); |
| | | } |
| | | |
| | | /** 获取入库最早的一条数据 **/ |
| | | /**获取入库最早的一条数据**/ |
| | | List<LocCache> locCaches = locCacheService.selectList(new EntityWrapper<LocCache>() |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_F.type) |
| | | .eq("frozen", 0) |
| | | .in("loc_no", new EntityWrapper<LocDetl>() |
| | | .setSqlSelect("DISTINCT loc_no") |
| | | .in("matnr", new EntityWrapper<Mat>() |
| | | .setSqlSelect("matnr") |
| | | .eq("tag_id", station.getCtnType()))) |
| | | .orderDesc(Arrays.asList("sort", "first_time"))); |
| | | |
| | | if (locCaches.isEmpty()) { |
| | |
| | | } |
| | | |
| | | for (LocCache locCache : locCaches) { |
| | | // 获取缓存区信息 |
| | | BasAreas basAreas = basAreasService.selectOne( |
| | | new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type)); |
| | | //获取缓存区信息 |
| | | BasAreas basAreas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type)); |
| | | if (Objects.isNull(basAreas)) { |
| | | throw new CoolException("库区不存在!!"); |
| | | } |
| | |
| | | |
| | | Mat mat = matList.stream().findFirst().get(); |
| | | |
| | | // BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>() |
| | | // .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | // .eq("ctn_type", mat.getTagId()) |
| | | // .eq("dev_no", params.getTarSite())); |
| | | |
| | | if (mat.getTagId() != station.getCtnType().longValue()){ |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>() |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | .eq("ctn_type", mat.getTagId()) |
| | | .eq("dev_no", params.getTarSite())); |
| | | if (Objects.isNull(station)) { |
| | | continue; |
| | | } |
| | | |
| | | /** 生成缓存区出库任务 */ |
| | | /**生成缓存区出库任务*/ |
| | | generateCacheOutTask(station, locCache, userId); |
| | | |
| | | /** 生成立库出库任务 */ |
| | | /**生成立库出库任务*/ |
| | | generateCRNOutTask(station, locCache, userId); |
| | | |
| | | return R.ok(); |
| | |
| | | if (Objects.isNull(param.getStation())) { |
| | | throw new CoolException("站点不能为空!!"); |
| | | } |
| | | // TODO 修改缓存站点状态及数据 |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>() |
| | | .eq("wrk_sts", 14L) |
| | | .eq("barcode", param.getCarBarcode())); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("数据错误,任务不存在!!"); |
| | | } |
| | | List<TaskDetl> taskDetls = taskDetlService |
| | | .selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", task.getWrkNo())); |
| | | if (Objects.isNull(taskDetls) || taskDetls.isEmpty()) { |
| | | throw new CoolException("数据错误,任务明细不存在!!"); |
| | | } |
| | | // // TODO 修改缓存站点状态及数据 |
| | | // Task task = taskService.selectOne(new EntityWrapper<Task>() |
| | | // .eq("wrk_sts", 14L) |
| | | // .eq("barcode", param.getCarBarcode())); |
| | | // if (Objects.isNull(task)) { |
| | | // throw new CoolException("数据错误,任务不存在!!"); |
| | | // } |
| | | // List<TaskDetl> taskDetls = taskDetlService |
| | | // .selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", task.getWrkNo())); |
| | | // if (Objects.isNull(taskDetls) || taskDetls.isEmpty()) { |
| | | // throw new CoolException("数据错误,任务明细不存在!!"); |
| | | // } |
| | | |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>() |
| | | .eq("dev_no", task.getStaNo())); |
| | | .eq("dev_no", param.getStation())); |
| | | if (Objects.isNull(station)) { |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | |
| | | } |
| | | basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo())); |
| | | |
| | | // 任务完成 |
| | | task.setWrkSts(15L); |
| | | |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("AGV任务完成失败!!"); |
| | | } |
| | | // // 任务完成 |
| | | // task.setWrkSts(15L); |
| | | // |
| | | // if (!taskService.updateById(task)) { |
| | | // throw new CoolException("AGV任务完成失败!!"); |
| | | // } |
| | | |
| | | List<WaitPakin> waitPakins = waitPakinService |
| | | .selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | }); |
| | | // 更新入库通知档 ioStatus ===>> Y |
| | | Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>() |
| | | .eq("zpallet", pakin.getZpallet()); |
| | | WaitPakin setParam = new WaitPakin(); |
| | | setParam.setLocNo(dto.getLocNo()); |
| | | setParam.setIoStatus("Y"); |
| | | setParam.setModiTime(now); |
| | | if (!waitPakinService.update(setParam, wrapper)) { |
| | | throw new CoolException("更新通知档失败"); |
| | | } |
| | | // // 更新入库通知档 ioStatus ===>> Y |
| | | // Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>() |
| | | // .eq("zpallet", pakin.getZpallet()); |
| | | // WaitPakin setParam = new WaitPakin(); |
| | | // setParam.setLocNo(dto.getLocNo()); |
| | | // setParam.setIoStatus("Y"); |
| | | // setParam.setModiTime(now); |
| | | // if (!waitPakinService.update(setParam, wrapper)) { |
| | | // throw new CoolException("更新通知档失败"); |
| | | // } |
| | | // 更新源站点信息 |
| | | sourceStaNo.setWrkNo(workNo); |
| | | sourceStaNo.setModiTime(now); |