From ece7b1d3e40674039d2707aa8ed6bfe778a54c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Fri, 3 Oct 2025 13:57:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B9=9D=E5=AE=AB=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WmsMessageServiceImpl.java | 27 ++++++++--- .../entity/BufferZoneConfig.java | 26 +++++++---- .../mapper/WcsIntegrationMapper.java | 9 ++-- .../impl/WcsIntegrationServiceImpl.java | 2 +- .../WcsIntegrationMapper.xml | 45 ++++++++++++++++--- 5 files changed, 84 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java b/src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java index 6d04886..e6cda9e 100644 --- a/src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java +++ b/src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java @@ -4,11 +4,7 @@ import com.alibaba.fastjson2.JSONObject; import com.gaotao.modules.api.entity.*; import com.gaotao.modules.api.service.InterfaceCallLogService; import com.gaotao.modules.api.service.WmsMessageService; -import com.gaotao.modules.automatedWarehouse.entity.AgvStation; -import com.gaotao.modules.automatedWarehouse.entity.BufferZoneConfig; -import com.gaotao.modules.automatedWarehouse.entity.PalletDetail; -import com.gaotao.modules.automatedWarehouse.entity.WcsCallbackTask; -import com.gaotao.modules.automatedWarehouse.entity.WmsOrderTask; +import com.gaotao.modules.automatedWarehouse.entity.*; import com.gaotao.modules.automatedWarehouse.mapper.WcsIntegrationMapper; import com.gaotao.modules.automatedWarehouse.service.WcsIntegrationService; import com.gaotao.modules.other.entity.InventoryMoveRequestDto; @@ -147,7 +143,7 @@ public class WmsMessageServiceImpl implements WmsMessageService { // 出库时从缓冲区配置获取 toWarehouseId = BufferZoneConfig.BUFFER_WAREHOUSE_ID.getValue(); toLocationId = BufferZoneConfig.BUFFER_LOCATION_ID.getValue(); - + inData.setToBarcode(BufferZoneConfig.BUFFER_Station_ID.getValue()); } else { throw new RuntimeException("不支持的事务类型:" + inData.getTransTypeDesc()); } @@ -173,6 +169,13 @@ public class WmsMessageServiceImpl implements WmsMessageService { // 如果是入库,同时更新对应的wms_order_task状态 if ("入库".equals(inData.getTransTypeDesc())) { updateOrderTaskStatusForInboundCallback(inData); + wcsIntegrationMapper.updatePalletCallingFlag(inData.getSite(), inData.getPalletId(), "Y", "SYS_WMS"); + } + // 如果是入库,同时更新对应的wms_order_task状态 + if ("出库".equals(inData.getTransTypeDesc())) { + updateOrderTaskStatusForOutCallback(inData); + wcsIntegrationMapper.reUpdatePalletDetailWcsFlag(inData.getSite(),inData.getPalletId()); + } log.info("WCS回调数据已保存:栈板={}, 任务类型={}, 目标位置={}-{}", @@ -775,7 +778,19 @@ public class WmsMessageServiceImpl implements WmsMessageService { private void updateMessageStatus(String messageId, String status) { saveMessageStatus(messageId, status); } + private void updateOrderTaskStatusForOutCallback(PalletWareHouseData inData) { + if(inData.getTaskNo()!=null&&inData.getItemNo()!=null){ + WmsOrderTask orderTask = wcsIntegrationMapper.findOrderTasksByTaskNoItem( + inData.getSite(),inData.getTaskNo(),inData.getItemNo()); + if(orderTask!=null){ + wcsIntegrationMapper.updateOrderTaskStatusAndWmsStatus( + orderTask.getId(), "进行中", "进行中" + ); + wcsIntegrationMapper.updateOrderTaskDetailStatusByTaskNoPalletId(inData.getSite(),inData.getTaskNo(),"移出立库","移出立库",inData.getPalletId()); + } + } + } /** * 收到入库回调时更新订单任务状态 * @param inData WCS回调数据 diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/entity/BufferZoneConfig.java b/src/main/java/com/gaotao/modules/automatedWarehouse/entity/BufferZoneConfig.java index 94c24b1..1411f72 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/entity/BufferZoneConfig.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/entity/BufferZoneConfig.java @@ -5,27 +5,30 @@ package com.gaotao.modules.automatedWarehouse.entity; * 用于定义缓冲区专用的仓库和库位 */ public enum BufferZoneConfig { - /** - * 缓冲区仓库ID + * 立库过渡站点站点ID */ - BUFFER_WAREHOUSE_ID("HCQ"), - + BUFFER_Station_ID("Virtual_AS"), /** - * 缓冲区库位ID + * 立库过渡站点仓库ID */ - BUFFER_LOCATION_ID("hcq"); + BUFFER_WAREHOUSE_ID("W01"), + /** + * 立库过渡站点库位ID + */ + BUFFER_LOCATION_ID("AS"); + private final String value; BufferZoneConfig(String value) { this.value = value; } - + public String getValue() { return value; } - + /** * 检查是否为缓冲区仓库 */ @@ -39,7 +42,12 @@ public enum BufferZoneConfig { public static boolean isBufferLocation(String locationId) { return BUFFER_LOCATION_ID.getValue().equals(locationId); } - + + public static boolean isBufferStation(String station) { + return BUFFER_Station_ID.getValue().equals(station); + } + + /** * 检查是否为缓冲区标签 */ diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java b/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java index 4b77bc4..f20d974 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java @@ -189,6 +189,7 @@ public interface WcsIntegrationMapper { * 更新栈板明细的wcs_flag为1 - AI制作 */ void updatePalletDetailWcsFlag(@Param("site") String site, @Param("palletId") String palletId); + void reUpdatePalletDetailWcsFlag(@Param("site") String site, @Param("palletId") String palletId); List getPalletDetailsNewDetail(@Param("site") String site, @Param("palletId") String palletId); @@ -274,7 +275,9 @@ public interface WcsIntegrationMapper { List findOrderTasksByTaskNo(@Param("site") String site, @Param("taskNo") String taskNo); - + WmsOrderTask findOrderTasksByTaskNoItem(@Param("site") String site, + @Param("taskNo") String taskNo, + @Param("itemNo") Integer itemNo); /** * 更新订单任务状态和WMS状态 - AI制作 @@ -282,12 +285,12 @@ public interface WcsIntegrationMapper { void updateOrderTaskStatusAndWmsStatus(@Param("id") Long id, @Param("status") String status, @Param("wmsStatus") String wmsStatus); - /** * 根据任务号更新订单任务明细状态 - AI制作 */ void updateOrderTaskDetailStatusByTaskNo(@Param("taskNo") String taskNo, @Param("status") String status, @Param("wmsStatus") String wmsStatus); - + void updateOrderTaskDetailStatusByTaskNoPalletId(@Param("site") String site,@Param("taskNo") String taskNo, @Param("status") String status, @Param("wmsStatus") String wmsStatus, @Param("palletId") String palletId); + /** * 查询立库调栈板出库的订单任务列表 - AI制作 */ diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java index 74a1607..746abb2 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java @@ -58,7 +58,7 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { // 再次检查栈板是否已经被调用 String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(data.get(i).getSite(), data.get(i).getPalletId()); if ("Y".equals(callingFlag)) { - throw new RuntimeException(data.get(i).getPalletId() + "栈板正在被调用中,请选择其他栈板"); + throw new RuntimeException(data.get(i).getPalletId() + "栈板当前无法被调用!"); } } diff --git a/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml b/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml index acb652c..91c2b2e 100644 --- a/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml +++ b/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml @@ -432,7 +432,13 @@ AND pallet_id = #{palletId} AND wcs_flag = 1 - + + UPDATE pallet_detail + SET wcs_flag = 1 + WHERE site = #{site} + AND pallet_id = #{palletId} + AND wcs_flag = 0 + + @@ -639,6 +667,11 @@ set status = #{status} ,wms_status = #{wmsStatus} where task_no = #{taskNo} + + update wms_order_task_detail + set status = #{status} ,wms_status = #{wmsStatus} + where task_no = #{taskNo} and site=#{site} and pallet_id=#{palletId} +