|
|
|
@ -11,6 +11,8 @@ import com.gaotao.modules.automatedWarehouse.entity.WcsCallbackTask; |
|
|
|
import com.gaotao.modules.automatedWarehouse.entity.WmsOrderTask; |
|
|
|
import com.gaotao.modules.automatedWarehouse.mapper.WcsIntegrationMapper; |
|
|
|
import com.gaotao.modules.automatedWarehouse.service.WcsIntegrationService; |
|
|
|
import com.gaotao.modules.other.entity.InventoryMoveRequestDto; |
|
|
|
import com.gaotao.modules.other.service.InventoryMoveService; |
|
|
|
import com.gaotao.modules.trans.entity.TransNoControl; |
|
|
|
import com.gaotao.modules.trans.service.TransNoControlService; |
|
|
|
import com.gaotao.modules.handlingunit.entity.HandlingUnit; |
|
|
|
@ -86,7 +88,8 @@ public class WmsMessageServiceImpl implements WmsMessageService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private InventoryStockMapper inventoryStockMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private InventoryMoveService inventoryMoveService; |
|
|
|
// 消息队列名称常量 |
|
|
|
private static final String INBOUND_FINISH_QUEUE = "wms:queue:inbound:finish"; |
|
|
|
private static final String ROBOT_PICKING_QUEUE = "wms:queue:robot:picking"; |
|
|
|
@ -235,26 +238,28 @@ public class WmsMessageServiceImpl implements WmsMessageService { |
|
|
|
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 { |
|
|
|
// 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(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 4. 查询托盘上的条码信息 |
|
|
|
// 需要通过其他方式查询PalletDetail,可能需要创建对应的Service |
|
|
|
List<PalletDetail> palletDetails = getPalletDetails(request.getSite(), request.getPalletId()); |
|
|
|
|
|
|
|
if (palletDetails.isEmpty()) { |
|
|
|
throw new RuntimeException("托盘上无条码信息:" + request.getPalletId()); |
|
|
|
return "托盘无条码信息,无需执行移库操作:" ; |
|
|
|
} |
|
|
|
|
|
|
|
// 5. 获取条码对应的HandlingUnit信息 |
|
|
|
@ -348,22 +353,24 @@ public class WmsMessageServiceImpl implements WmsMessageService { |
|
|
|
handlingUnitService.updateById(hu); |
|
|
|
} |
|
|
|
|
|
|
|
// 11. 更新托盘位置信息 |
|
|
|
// 需要查询目标站点 |
|
|
|
// AgvStation targetStation = getAgvStationByWarehouseAndLocation( |
|
|
|
// request.getToWarehouseId(), request.getToLocationId()); |
|
|
|
//------------------------------------------------------------------- |
|
|
|
// if (targetStation != null) { |
|
|
|
|
|
|
|
pallet.setLocationCode(request.getToStation()); |
|
|
|
|
|
|
|
palletService.updateById(pallet); |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
String result = "移库操作完成,出库事务号:" + stoTransNo + ",入库事务号:" + stiTransNo; |
|
|
|
|
|
|
|
log.info("托盘移库操作完成,托盘ID: {}, 出库事务号: {}, 入库事务号: {}", |
|
|
|
request.getPalletId(), stoTransNo, stiTransNo); |
|
|
|
|
|
|
|
|
|
|
|
// 11. IFS移库 |
|
|
|
InventoryMoveRequestDto ifsRequest = new InventoryMoveRequestDto(); |
|
|
|
ifsRequest.setSite("55"); |
|
|
|
ifsRequest.setTargetLocationId(request.getToLocationId()); |
|
|
|
List<String> handlingUnitIds = handlingUnits.stream() |
|
|
|
.map(HandlingUnit::getUnitId).collect(Collectors.toList()); |
|
|
|
ifsRequest.setHandlingUnitIds(handlingUnitIds); |
|
|
|
return result; |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|