feat(int-core): 补充出库时货位信息

- 在出库物料时,增加货位信息的获取和设置
-通过 OperationOutMapper 查询 OutFqDTO 对象,获取货位信息
- 如果查询到货位信息,则设置到库存对象和 ZLotMaterialCompleteTransaction 对象中
- 优化了出库流程,提高了数据的完整性和准确性
This commit is contained in:
tangyu 2025-03-04 09:16:00 +08:00
parent c5c2e5049d
commit e341032406

View File

@ -2,6 +2,7 @@ package com.foreverwin.iep.integration.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.foreverwin.iep.common.faas.common.util.StringUtils;
import com.foreverwin.iep.integration.domain.InvokeRequest;
import com.foreverwin.iep.integration.domain.InvokeResponse;
@ -14,10 +15,12 @@ import com.foreverwin.iep.integration.mapper.OutSapMaterialMapper;
import com.foreverwin.iep.integration.service.OutMaterialCompleteLogService;
import com.foreverwin.iep.integration.service.OutMaterialSapService;
import com.foreverwin.iep.integration.service.RegisterDocumentService;
import com.foreverwin.iep.prd.dto.OutFqDTO;
import com.foreverwin.iep.prd.entity.Item;
import com.foreverwin.iep.prd.entity.ZLotMaterialCompleteTransaction;
import com.foreverwin.iep.wip.dto.OperationOutBomComponentDTO;
import com.foreverwin.iep.wip.feign.RemoteWipService;
import com.foreverwin.iep.wip.mapper.OperationOutMapper;
import com.foreverwin.mom.common.core.constant.SecurityConstants;
import com.foreverwin.mom.common.core.util.R;
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
@ -46,6 +49,7 @@ public class OutMaterialSapServiceImpl implements OutMaterialSapService {
private final RemoteWmsInventoryService remoteWmsInventoryService;
private final RemoteWmsInventoryRecordService remoteWmsInventoryRecordService;
private final RemoteWipService zLotMaterialCompleteTransactionService;
private final OperationOutMapper operationOutMapper;
private final String messageId = "ZMM_MES_GOODSMVT_CREATE";
@ -436,12 +440,16 @@ public class OutMaterialSapServiceImpl implements OutMaterialSapService {
inventory.setOriginalQty(qtyDone);
inventory.setQtyOnHand(qtyDone);
inventory.setProductionDate(pdt);
inventory.setWmsStorageBinBo(erpInventory);
inventory.setStatus("1001");
//根据存储位置获取货格
List<OutFqDTO> outFqDTOS = operationOutMapper.selectOutFq(site, erpInventory);
if (CollectionUtils.isNotEmpty(outFqDTOS)) {
inventory.setWmsStorageBinBo(outFqDTOS.get(0).getHandle());
}else {
inventory.setWmsStorageBinBo("null");
}
inventory.setQualityInspectionStatus(grade);
inventory.setQualityInspectionStatus(grade);
inventory.setRollType(uom);
if (!StringUtils.isEmpty(subUom)){
@ -487,6 +495,12 @@ public class OutMaterialSapServiceImpl implements OutMaterialSapService {
zLotMaterialCompleteTransaction.setDateCreate(LocalDateTime.now());
zLotMaterialCompleteTransaction.setCreator(SecurityUtils.getUserName());
zLotMaterialCompleteTransaction.setSyncMsgText("创建成功");
List<OutFqDTO> outFqDTOS = operationOutMapper.selectOutFq(site, outMaterialCompleteLog.getErpInventory());
if (CollectionUtils.isNotEmpty(outFqDTOS)) {
zLotMaterialCompleteTransaction.setStorageBin(outFqDTOS.get(0).getStorageBin());
zLotMaterialCompleteTransaction.setWarehouseCode(outFqDTOS.get(0).getWarehouseCode());
}
ZLotMaterialCompleteTransaction.add(zLotMaterialCompleteTransaction);
}
zLotMaterialCompleteTransactionService.remoteSaveOrUpdateBatchZLotMaterialCompleteTransaction(ZLotMaterialCompleteTransaction, SecurityConstants.FROM_IN);