refactor(出库): 优化物料出库时预留信息获取逻辑
- 新增 RemoteWmsInventoryRecordService 服务引用 - 在出库处理中添加预留信息获取步骤 - 若未找到预留信息,则返回错误响应 - 更新预留编号和预留项目编号的赋值
This commit is contained in:
parent
6d0daa6adf
commit
947f899bf1
@ -13,11 +13,14 @@ import com.foreverwin.iep.integration.mapper.OutSapCompleteMapper;
|
||||
import com.foreverwin.iep.integration.mapper.OutSapMaterialMapper;
|
||||
import com.foreverwin.iep.integration.service.OutMaterialSapService;
|
||||
import com.foreverwin.iep.integration.service.RegisterDocumentService;
|
||||
import com.foreverwin.iep.wip.dto.OperationOutBomComponentDTO;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import com.foreverwin.mom.wms.api.feign.RemoteWmsInventoryRecordService;
|
||||
import com.foreverwin.mom.wms.api.feign.RemoteWmsInventoryService;
|
||||
import com.foreverwin.mom.wms.entity.Inventory;
|
||||
import com.google.protobuf.ServiceException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -37,6 +40,7 @@ public class OutMaterialSapServiceImpl implements OutMaterialSapService {
|
||||
private final OutSapMaterialMapper outSapMaterialMapper;
|
||||
private final RegisterDocumentService registerDocumentService;
|
||||
private final RemoteWmsInventoryService remoteWmsInventoryService;
|
||||
private final RemoteWmsInventoryRecordService remoteWmsInventoryRecordService;
|
||||
|
||||
private final String messageId = "ZMM_MES_GOODSMVT_CREATE";
|
||||
|
||||
@ -236,8 +240,16 @@ public class OutMaterialSapServiceImpl implements OutMaterialSapService {
|
||||
jsonObject.put("UMWRK", ""); // 收货工厂/发货工厂
|
||||
jsonObject.put("UMLGO", ""); // 收货/发货库存地点
|
||||
jsonObject.put("UMCHA", ""); // 收货/发货批量
|
||||
jsonObject.put("RSNUM", consumptionTransaction.getReservedNo()); // 预留/相关需求的编号
|
||||
jsonObject.put("RSPOS", consumptionTransaction.getReservedLine()); // 预留 / 相关需求的项目编号
|
||||
R<OperationOutBomComponentDTO> reserve = remoteWmsInventoryRecordService.getReserve(consumptionTransaction.getSite(), consumptionTransaction.getShopOrder(), consumptionTransaction.getComponentItem());
|
||||
OperationOutBomComponentDTO data = reserve.getData();
|
||||
if (data == null){
|
||||
invokeResponse.setResult("E");
|
||||
invokeResponse.setMessageContent("未找到预留行号与预留编号!");
|
||||
return invokeResponse;
|
||||
}
|
||||
|
||||
jsonObject.put("RSNUM", data.getReserved()); // 预留/相关需求的编号
|
||||
jsonObject.put("RSPOS", data.getReservedSeq()); // 预留 / 相关需求的项目编号
|
||||
itemList.add(jsonObject);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user