|
|
|
@ -569,36 +569,27 @@ public class WmsMessageServiceImpl implements WmsMessageService { |
|
|
|
pallet.setLocationCode(request.getToStation()); |
|
|
|
pallet.setWcsLocation(request.getToStation()); |
|
|
|
|
|
|
|
palletMapper.updateLocationWithPalletId(pallet.getSite(),pallet.getPalletId(),pallet.getLocationCode(),pallet.getWcsLocation()); |
|
|
|
// palletMapper.updateLocationWithPalletId(pallet.getSite(),pallet.getPalletId(),pallet.getLocationCode(),pallet.getWcsLocation()); |
|
|
|
|
|
|
|
//如果更新wcs库位 |
|
|
|
//这里插入逻辑 |
|
|
|
// 检查该站点是否还有其他栈板,如果没有则更新站点状态为空闲 - rqrq(改用手写SQL避免锁表) |
|
|
|
long otherPalletCount = palletMapper.countOtherPalletsByLocation( |
|
|
|
request.getSite(), currentLocationCode, request.getPalletId()); |
|
|
|
|
|
|
|
if (otherPalletCount == 0) { |
|
|
|
// 没有其他栈板在该站点,更新站点状态为空闲 |
|
|
|
log.info("站点 {} 无其他栈板,更新状态为空闲", currentLocationCode); |
|
|
|
wcsIntegrationMapper.updateAgvStationStatus(currentLocationCode, 0, "空闲"); |
|
|
|
} else { |
|
|
|
log.info("站点 {} 还有 {} 个其他栈板,保持站点状态", currentLocationCode, otherPalletCount); |
|
|
|
} |
|
|
|
// long otherPalletCount = palletMapper.countOtherPalletsByLocation( |
|
|
|
// request.getSite(), currentLocationCode, request.getPalletId()); |
|
|
|
// |
|
|
|
// if (otherPalletCount == 0) { |
|
|
|
// // 没有其他栈板在该站点,更新站点状态为空闲 |
|
|
|
// log.info("站点 {} 无其他栈板,更新状态为空闲", currentLocationCode); |
|
|
|
// wcsIntegrationMapper.updateAgvStationStatus(currentLocationCode, 0, "空闲"); |
|
|
|
// } else { |
|
|
|
// log.info("站点 {} 还有 {} 个其他栈板,保持站点状态", currentLocationCode, otherPalletCount); |
|
|
|
// } |
|
|
|
String fromWarehouseId; |
|
|
|
String fromLocationId; |
|
|
|
//如果是*说明在立库里,需要查询里面料的当前位置 |
|
|
|
// if(currentStation.getLocationCode().equals("*")){ |
|
|
|
// List<PalletDetail> palletDetail2 = getPalletDetails(request.getSite(), request.getPalletId()); |
|
|
|
// List<HandlingUnit> checkPart= handlingUnitService.getHandlingUnitsBySiteAndUnid(palletDetail2.getFirst().getSite(),palletDetail2.getFirst().getSerialNo()); |
|
|
|
// if(checkPart.size()==0){ |
|
|
|
// throw new RuntimeException("栈板明细列表的条码号在WMS不存在,数据有问题"); |
|
|
|
// } |
|
|
|
// fromWarehouseId = checkPart.getFirst().getWarehouseId(); |
|
|
|
// fromLocationId = checkPart.getFirst().getLocationId(); |
|
|
|
// }else { |
|
|
|
|
|
|
|
fromWarehouseId = currentStation.getWarehouseCode(); |
|
|
|
fromLocationId = currentStation.getLocationCode(); |
|
|
|
// } |
|
|
|
|
|
|
|
if(fromWarehouseId.equals(request.getToWarehouseId())&&fromLocationId.equals(request.getToLocationId())){ |
|
|
|
return "托盘无需执行移库操作:" + request.getPalletId(); |
|
|
|
} |
|
|
|
|