From ac4341ea6b66ae02427d39d35f41d42d78b2eb2e Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期五, 14 二月 2025 10:08:32 +0800 Subject: [PATCH] # --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java index 3c9330c..02263e7 100644 --- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java +++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java @@ -6,7 +6,7 @@ import com.zy.asrs.wms.asrs.entity.*; import com.zy.asrs.wms.asrs.entity.enums.LocStsType; import com.zy.asrs.wms.asrs.entity.enums.LocTypeHeightType; -import com.zy.asrs.wms.asrs.entity.enums.ShelvesRuleType; +import com.zy.asrs.wms.asrs.entity.param.FieldParam; import com.zy.asrs.wms.asrs.mapper.ViewLocDetlMapper; import com.zy.asrs.wms.asrs.mapper.ViewTaskDetlMapper; import com.zy.asrs.wms.asrs.service.*; @@ -36,22 +36,29 @@ private ViewLocDetlMapper viewLocDetlMapper; @Autowired private ViewTaskDetlMapper viewTaskDetlMapper; + @Autowired + private MatService matService; //浠庡簱瀛樻垨浠诲姟涓尮閰嶇浉閭诲簱浣�(婊℃墭鐩�) - public Loc getNeighborLoc(Long taskType, OrderDetl orderDetl, Integer locTypeHeight) { + public Loc getNeighborLoc(Long taskType, Long matId, String batch, List<FieldParam> uniqueFields, Integer locTypeHeight) { //婊℃墭鐩� + Mat mat = matService.getById(matId); + if (mat == null) { + return null; + } + //浠庝换鍔′腑杩涜鍖归厤 List<Loc> locs = new ArrayList<>(); - List<Map<String, Object>> list = viewTaskDetlMapper.getList(orderDetl.getMat$().getMatnr(), orderDetl.getBatch(), orderDetl.getUniqueField()); + List<Map<String, Object>> list = viewTaskDetlMapper.getList(mat.getMatnr(), batch, uniqueFields); for (Map<String, Object> map : list) { Task task = taskService.getById(map.get("taskId").toString()); - if(task == null) { + if (task == null) { continue; } String targetLoc = task.getTargetLoc(); Loc one = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, targetLoc)); - if(one == null) { + if (one == null) { continue; } locs.add(one); @@ -64,10 +71,10 @@ //浠庡簱瀛樹腑杩涜鍖归厤 List<Loc> locs2 = new ArrayList<>(); - List<Map<String, Object>> list2 = viewLocDetlMapper.getList(orderDetl.getMat$().getMatnr(), orderDetl.getBatch(), orderDetl.getUniqueField()); + List<Map<String, Object>> list2 = viewLocDetlMapper.getList(mat.getMatnr(), batch, uniqueFields, null); for (Map<String, Object> map : list2) { Loc one = locService.getById(map.get("locId").toString()); - if(one == null) { + if (one == null) { continue; } locs2.add(one); -- Gitblit v1.9.1