From 77a44aee873a8a54843fd5762fa1bee046c33393 Mon Sep 17 00:00:00 2001 From: Comair <1464848666@qq.com> Date: Mon, 21 Apr 2025 11:17:11 +0800 Subject: [PATCH] =?UTF-8?q?wcsUtil=E7=B1=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkj/wcs/third/workbinWcs/WCSUtil.java | 61 +++---------------- 1 file changed, 9 insertions(+), 52 deletions(-) diff --git a/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/WCSUtil.java b/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/WCSUtil.java index 7cce6ef..71b82ba 100644 --- a/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/WCSUtil.java +++ b/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/WCSUtil.java @@ -19,6 +19,7 @@ import com.shkj.wcs.third.rcs.dto.RcsCancelTaskDto; import com.shkj.wcs.third.rcs.dto.RcsCreateTaskDto; import com.shkj.wcs.third.rcs.dto.RcsIdList; import com.shkj.wcs.third.rcs.dto.RcsThirdResult; +import com.shkj.wcs.third.workbinWcs.dto.WcsIncomingCheckDto; import com.shkj.wms.bo.AGVMoveBo; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -89,41 +90,20 @@ public class WCSUtil { } + /** - * 创建任务 - * wcs系统通过此接口向rcs系统下发创建任务指令 - * - * @param dto dto - * @return {@code Result} - */ - public Result rcsCreateTask(RcsCreateTaskDto dto) { - String json = JSONObject.toJSONString(dto); - try { - Map headerMap = getHeaderMap(); - String res = HttpRequest.post(agvCreateTaskUrl) - .addHeaders(headerMap) - .body(json) - .execute().body(); - Result result = parseThirdRcsResult(res); - return result; - } catch (Exception e) { - e.printStackTrace(); - log.error("createTask 方法出错了 = {}", e.getMessage()); - return Result.err().msg(e.getMessage()); - } - } - /** - * 创建任务 + * 生产区入库校验 * wcs系统通过此接口向rcs系统下发创建任务指令 * * @param dto dto * @return {@code Result} */ - public Result wcsIncomingTrayCheck(Wcs dto) { - String json = JSONObject.toJSONString(dto); + public Result wcsIncomingTrayCheck(WcsIncomingCheckDto dto) { + String json = JSONObject.toJSONString(dto.getBody()); try { Map headerMap = getHeaderMap(); - String res = HttpRequest.post(agvCreateTaskUrl) + headerMap.put("businessType","trayCheck"); + String res = HttpRequest.post(wcsIncomingTrayCheckUrl) .addHeaders(headerMap) .body(json) .execute().body(); @@ -131,7 +111,7 @@ public class WCSUtil { return result; } catch (Exception e) { e.printStackTrace(); - log.error("createTask 方法出错了 = {}", e.getMessage()); + log.error("wcsIncomingTrayCheck 方法出错了 = {}", e.getMessage()); return Result.err().msg(e.getMessage()); } } @@ -204,30 +184,7 @@ public class WCSUtil { } - /** - * AGV搬运 - * - * @param bo - * @return {@link Result}<{@link Boolean}> - */ - public Result moveByAGV(AGVMoveBo bo) { - RcsCreateTaskDto dto = new RcsCreateTaskDto(); - dto.setMapId(1); - dto.setTaskType(bo.getTaskType()); - dto.setTaskId(bo.getTaskId().toString()); - //库位编号 - List idList = new ArrayList<>(); - List points = bo.getPoints(); - for (String point : points) { - RcsIdList rcsIdList = new RcsIdList(); - rcsIdList.setId(point); - log.error(point); - idList.add(rcsIdList); - } - dto.setTargets(idList); - return rcsCreateTask(dto); -// return Result.ok(); - } + /** * 获取AGV实时状态信息