From 2f8b55fe06d610896f7334e3854cbe9c5bbc0882 Mon Sep 17 00:00:00 2001 From: zhangzhiqiang Date: Thu, 4 May 2023 20:39:31 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"rev:=E4=BF=AE=E6=94=B9=E7=BB=93?= =?UTF-8?q?=E6=9E=84"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1ee9d736 --- .../nl/wms/ext/acs/service/impl/AgvInstService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AgvInstService.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AgvInstService.java index 8117b083..504c5ebd 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AgvInstService.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AgvInstService.java @@ -72,7 +72,7 @@ public class AgvInstService { JSONObject cacheLine = WQLObject.getWQLObject("SCH_cacheLine_region_relation").query("region_code = '"+devicePoint.getRegion_code()+"'").uniqueResult(0); nextPoint = cacheLine.getString("cacheline_code"); //满料请求:查询缓存线空载具列表 - cacheVehile = getEmpCacheVehile(nextPoint, null); + cacheVehile = getCacheVehile(nextPoint, null); if (StringUtils.isBlank(cacheVehile)) { throw new BadRequestException("缓存线:"+nextPoint+"没有可用空载具"); } @@ -96,13 +96,14 @@ public class AgvInstService { //3.agv根据对应载具列表行进扫码匹配:匹配到对应物料则创建点对点任务 public void callMatter(JSONObject task){ //参数 + String targetDevice = task.getString("next_point_code"); String material_id = task.getString("material_id"); JSONObject devicePoint = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code = '" + targetDevice + "' and is_delete = 0 and is_used = 1").uniqueResult(0); JSONObject cacheLine = WQLObject.getWQLObject("SCH_cacheLine_region_relation").query("region_code = '"+devicePoint.getString("region_code")+"' and is_active = '"+StatusEnum.STATUS_TRUE.getCode()+"'").uniqueResult(0); Assert.notNull(cacheLine, String.format("区域%s对应缓存线信息不存在", devicePoint.getString("region_code"))); //缓存线位置编码 :缺料请求获取缓存线满载具列表 String startPoint = cacheLine.getString("cacheline_code"); - String cacheVehile = getEmpCacheVehile(startPoint, material_id); + String cacheVehile = getCacheVehile(startPoint, material_id); if (StringUtils.isBlank(cacheVehile)) { throw new BadRequestException("缓存线:"+startPoint+"没有物料"+material_id+"对应可用载具"); } @@ -121,9 +122,8 @@ public class AgvInstService { } - public String getEmpCacheVehile(String cacheLine, String materialId){ - WQLObject taskTable = WQLObject.getWQLObject("sch_base_task"); - JSONArray runingTask = taskTable.query("point_code2 = '" + cacheLine + "' and task_status < '" + StatusEnum.TASK_FINISH.getCode() + "'").getResultJSONArray(0); + public String getCacheVehile(String cacheLine,String materialId){ + JSONArray runingTask = WQLObject.getWQLObject("sch_base_task").query("point_code2 = '" + cacheLine + "' and task_status < '" + StatusEnum.TASK_FINISH.getCode() + "'").getResultJSONArray(0); String status = StringUtils.isBlank(materialId) ? StatusEnum.CACHE_VEL_EMT.getCode() : StatusEnum.CACHE_VEL_FULL.getCode(); JSONArray result = WQL.getWO("sch_point").addParamMap(MapOf.of("flag", "6", "vehicle_status", status, "material_id", materialId)).process().getResultJSONArray(0); if (result.size()>0){