| | |
| | | import com.zy.asrs.entity.result.ForwardAGVTaskDTO; |
| | | import com.zy.asrs.entity.result.HIKApiDTO; |
| | | import com.zy.asrs.entity.result.HIKResultDTO; |
| | | import com.zy.asrs.enums.LocAreaType; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.enums.OrderSettle; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private BasContainerService basContainerService; |
| | | @Autowired |
| | | private BasAreasService basAreasService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | log.error("", e); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // 生成入库单据 |
| | |
| | | .eq("frozen", 0) |
| | | .ne("full_plt", "Y") |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type).orderAsc(Arrays.asList("row1")))); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/9/22 |
| | | * @description: 呼叫AGV搬运 |
| | | * @description: 呼叫空车 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | |
| | | */ |
| | | @Override |
| | | public R OutCallAgv(AgvCallParams params, Long userId) { |
| | | /**获取入库最早的一条数据**/ |
| | | LocCache locCaches = locCacheService.selectOne(new EntityWrapper<LocCache>() |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_F.type) |
| | | .eq("frozen", 0) |
| | |
| | | throw new CoolException("站点正在执行任务!!"); |
| | | } |
| | | |
| | | generateOutTask(station, locCaches, userId); |
| | | /**生成缓存区出库任务*/ |
| | | generateCacheOutTask(station, locCaches, userId); |
| | | |
| | | /**生成立库出库任务*/ |
| | | generateCRNOutTask(locCaches); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R callEmptyCar(AgvCallParams params) { |
| | | |
| | | List<LocCache> locSts = locCacheService.selectList(new EntityWrapper<LocCache>().eq("loc_sts", LocStsType.LOC_STS_TYPE_D.type)); |
| | | if (locSts.isEmpty()){ |
| | | throw new CoolException("暂无空板库位"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 生成立库出库任务 |
| | | * @author Ryan |
| | | * @date 2025/12/3 8:06 |
| | | * @param locCaches |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void generateCRNOutTask(LocCache locCaches) { |
| | | if (Objects.isNull(locCaches)) { |
| | | throw new CoolException("库位不能为空!!"); |
| | | } |
| | | 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("库区不存在!!"); |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("area_id", basAreas.getAreaNo()) |
| | | .eq("loc_id", locCaches.getId())); |
| | | |
| | | if (Objects.isNull(locDetls)) { |
| | | throw new CoolException("库存明细不存在!!"); |
| | | } |
| | | |
| | | //按物料编码分类 |
| | | Map<String, List<LocDetl>> listMap = locDetls.stream().collect(Collectors.groupingBy(LocDetl::getMatnr)); |
| | | listMap.forEach((key, detls) -> { |
| | | |
| | | }); |
| | | |
| | | locDetls.forEach(locDetl -> { |
| | | |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/9/25 |
| | | * @description: 呼叫AGV生成出库任务 |
| | | * @version 1.0 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void generateOutTask(BasStation station, LocCache loc, Long userId) { |
| | | public void generateCacheOutTask(BasStation station, LocCache loc, Long userId) { |
| | | // 获取工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.PICK.type); |
| | | // 保存工作档 |
| | |
| | | .setModiUser(userId); |
| | | taskDetls.add(wrkDetl); |
| | | }); |
| | | |
| | | |
| | | |
| | | //保存工作档明细 |
| | | if (!taskDetlService.insertBatch(taskDetls)) { |
| | |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals("O")) { |
| | | loc.setLocSts("S"); // S.入库预约 |
| | | if (loc.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | loc.setLocSts(LocStsType.LOC_STS_TYPE_S.type); // S.入库预约 |
| | | loc.setModiTime(new Date()); |
| | | loc.setModiUser(userId); |
| | | if (!locCacheService.updateById(loc)) { |