常熟吴彦祖 2 months ago
parent
commit
87aaafad73
  1. 45
      src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java

45
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<PalletDetail> getPalletDetails(String site, String palletId) {
try {
// 通过WcsIntegrationService获取托盘明细返回的是Map集合
// 查询参数使用驼峰命名与Service接口约定一致
List<Map<String, Object>> palletDetailMaps = wcsIntegrationService.getPalletDetails(
Map.of("site", site, "palletId", palletId));
List<Map<String, Object>> palletDetailMaps = wcsIntegrationMapper.getPalletDetails(
site,palletId,null,null);
// 将Map转换为PalletDetail对象
List<PalletDetail> palletDetails = new ArrayList<>();
for (Map<String, Object> detailMap : palletDetailMaps) {
@ -824,8 +822,8 @@ public class WmsMessageServiceImpl implements WmsMessageService {
*/
private AgvStation getAgvStationByCode(String stationCode) {
try {
// getAgvStations方法不需要参数返回所有站点需要自己过滤
List<Map<String, Object>> stations = wcsIntegrationService.getAgvStations(new HashMap<>());
// getAgvStations方法不需要参数返回所有站点需要自己过滤wcsIntegrationMapper.getAgvStations();
List<Map<String, Object>> stations = wcsIntegrationMapper.getAgvStations();
for (Map<String, Object> 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<Map<String, Object>> stations = wcsIntegrationService.getAgvStations(new HashMap<>());
for (Map<String, Object> 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

Loading…
Cancel
Save