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 a171199..5011b7c 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 @@ -7,7 +7,7 @@ import com.gaotao.modules.api.service.WmsMessageService; import com.gaotao.modules.automatedWarehouse.entity.*; import com.gaotao.modules.automatedWarehouse.mapper.WcsIntegrationMapper; import com.gaotao.modules.automatedWarehouse.service.AutoTaskService; -import com.gaotao.modules.automatedWarehouse.service.WcsIntegrationService; + import com.gaotao.modules.base.entity.PalletType; import com.gaotao.modules.base.service.Impl.PalletTypeServiceImpl; import com.gaotao.modules.base.service.PalletTypeService; @@ -68,9 +68,7 @@ public class WmsMessageServiceImpl implements WmsMessageService { private PalletService palletService; @Autowired private PalletMapper palletMapper; - - @Autowired - private WcsIntegrationService wcsIntegrationService; + @Autowired private WcsIntegrationMapper wcsIntegrationMapper; @@ -788,11 +786,11 @@ public class WmsMessageServiceImpl implements WmsMessageService { */ private List getPalletDetails(String site, String palletId) { try { - // 通过WcsIntegrationService获取托盘明细,返回的是Map集合 + // 查询参数使用驼峰命名(与Service接口约定一致) - List> palletDetailMaps = wcsIntegrationService.getPalletDetails( - Map.of("site", site, "palletId", palletId)); - + List> palletDetailMaps = wcsIntegrationMapper.getPalletDetails( + site,palletId,null,null); + // 将Map转换为PalletDetail对象 List palletDetails = new ArrayList<>(); for (Map detailMap : palletDetailMaps) { @@ -824,8 +822,8 @@ public class WmsMessageServiceImpl implements WmsMessageService { */ private AgvStation getAgvStationByCode(String stationCode) { try { - // getAgvStations方法不需要参数,返回所有站点,需要自己过滤 - List> stations = wcsIntegrationService.getAgvStations(new HashMap<>()); + // getAgvStations方法不需要参数,返回所有站点,需要自己过滤wcsIntegrationMapper.getAgvStations(); + List> stations = wcsIntegrationMapper.getAgvStations(); for (Map stationData : stations) { String code = (String) stationData.get("stationCode"); if (stationCode.equals(code)) { @@ -843,32 +841,7 @@ public class WmsMessageServiceImpl implements WmsMessageService { return null; } } - - /** - * 根据仓库和库位获取AGV站点信息 - */ - private AgvStation getAgvStationByWarehouseAndLocation(String warehouseCode, String locationCode) { - try { - // getAgvStations方法返回所有站点,需要自己过滤 - List> stations = wcsIntegrationService.getAgvStations(new HashMap<>()); - for (Map stationData : stations) { - String warehouse = (String) stationData.get("warehouseCode"); - String location = (String) stationData.get("locationCode"); - if (warehouseCode.equals(warehouse) && locationCode.equals(location)) { - AgvStation station = new AgvStation(); - // SQL中使用了驼峰别名,所以使用驼峰key - station.setStationCode((String) stationData.get("stationCode")); - station.setWarehouseCode((String) stationData.get("warehouseCode")); - station.setLocationCode((String) stationData.get("locationCode")); - return station; - } - } - return null; - } catch (Exception e) { - log.error("查询AGV站点失败:{}", e.getMessage(), e); - return null; - } - } + /** * 更新库存 - 手写SQL实现,支持负库存和wdr字段 - rqrq