Browse Source

pda入库

master
常熟吴彦祖 8 months ago
parent
commit
f007d527de
  1. 47
      src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java
  2. 8
      src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java
  3. 11
      src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsTaskServiceImpl.java
  4. 1
      src/main/java/com/gaotao/modules/other/service/impl/InventoryMoveServiceImpl.java
  5. 17
      src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml

47
src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java

@ -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) {

8
src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java

@ -242,11 +242,15 @@ public interface WcsIntegrationMapper {
/**
* 根据栈板ID和动作类型查找订单任务 - AI制作
*/
List<WmsOrderTask> findOrderTasksByPalletAndActionType(@Param("site") String site,
List<WmsOrderTask> findOrderTasksByPalletAndActionType(@Param("site") String site,
@Param("palletId") String palletId,
@Param("sourceType") String sourceType,
@Param("status") String status);
List<WmsOrderTask> findOrderTasksByTaskNo(@Param("site") String site,
@Param("taskNo") String taskNo);
/**
* 更新订单任务状态和WMS状态 - AI制作
*/

11
src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsTaskServiceImpl.java

@ -2,6 +2,7 @@ package com.gaotao.modules.automatedWarehouse.service.impl;
import com.gaotao.modules.api.entity.WareHouseTransferRequest;
import com.gaotao.modules.api.service.WcsApiService;
import com.gaotao.modules.api.service.WmsMessageService;
import com.gaotao.modules.automatedWarehouse.entity.WcsCallbackTask;
import com.gaotao.modules.automatedWarehouse.entity.WmsOrderTask;
@ -132,7 +133,7 @@ public class WcsTaskServiceImpl implements WcsTaskService {
request.setToWarehouseId(callbackTask.getToWarehouseId());
request.setToLocationId(callbackTask.getToLocationId());
request.setTransType("移库");
request.setToStation("*"); // 立库内的站点都为*
request.setToStation(callbackTask.getToStation()); // 立库内的站点都为*
// 根据transTypeDesc判断业务类型
if ("入库".equals(callbackTask.getTransTypeDesc())) {
@ -155,11 +156,9 @@ public class WcsTaskServiceImpl implements WcsTaskService {
private void updateOrderTaskStatusForInbound(WcsCallbackTask callbackTask) {
try {
// 查找对应的wms_order_task记录source_type=组盘入库pallet_id一致status=已创建
List<WmsOrderTask> orderTasks = wcsIntegrationMapper.findOrderTasksByPalletAndActionType(
callbackTask.getSite(),
callbackTask.getPalletId(),
"组盘入库",
"已创建"
List<WmsOrderTask> orderTasks = wcsIntegrationMapper.findOrderTasksByTaskNo(
callbackTask.getSite(),
callbackTask.getTaskNo()
);
if (orderTasks != null && !orderTasks.isEmpty()) {

1
src/main/java/com/gaotao/modules/other/service/impl/InventoryMoveServiceImpl.java

@ -64,6 +64,7 @@ public class InventoryMoveServiceImpl implements InventoryMoveService {
@Value("${custom.ifs-domainUserID}")
private String domainUserID;
//-----别改--------
@Override
@Transactional
public void confirmInventoryMove(InventoryMoveRequestDto dto) {

17
src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml

@ -519,7 +519,7 @@
to_warehouse_id as toWarehouseId, to_location_id as toLocationId,
status, created_time as createdTime, process_start_time as processStartTime,
process_end_time as processEndTime, error_msg as errorMsg,
retry_count as retryCount, remark
retry_count as retryCount, remark,task_no,item_no,to_station
from wcs_callback_task
where site = #{site} and status in ('已录入', '处理失败')
and (retry_count is null or 3>retry_count )
@ -569,6 +569,21 @@
and status = #{status}
order by created_time desc
</select>
<select id="findOrderTasksByTaskNo" resultType="WmsOrderTask">
select id, site, task_no as taskNo, item_no as itemNo, source_type as sourceType,
source_bill_no as sourceBillNo, source_line_id as sourceLineId, part_no as partNo,
qty, batch_no as batchNo, serial_no as serialNo, from_location as fromLocation,
to_location as toLocation, pallet_id as palletId, agv_code as agvCode,
priority, status, wms_send_time as wmsSendTime, wcs_receive_time as wcsReceiveTime,
start_time as startTime, complete_time as completeTime, error_code as errorCode,
error_msg as errorMsg, created_by as createdBy, created_time as createdTime,
updated_time as updatedTime, wcs_task_id as wcsTaskId, finish_qty as finishQty,
wms_status as wmsStatus
from wms_order_task
where site = #{site}
and task_no=#{taskNo}
order by created_time desc
</select>
<!-- 更新订单任务状态和WMS状态 - AI制作 -->
<update id="updateOrderTaskStatusAndWmsStatus">

Loading…
Cancel
Save