refactor(int-core): 更新库存状态

- 在 CopyShopOrderStatisticTransController 中为 inventory 对象添加状态码 "1001"
- 此修改确保库存记录具有正确的状态,以反映其生产日期已设置
This commit is contained in:
tangyu 2025-03-03 16:49:32 +08:00
parent bd4d6f0854
commit 80e93faf0f
3 changed files with 53 additions and 2 deletions

View File

@ -250,6 +250,7 @@ public class OutSapReportController {
} else {
String site = TenantContextHolder.getTenantId();
outMaterialSapService.warehousing(list, site);
outMaterialSapService.saveMaterialCompleteData(list, site);
return R.ok();
}
}

View File

@ -19,4 +19,6 @@ public interface OutMaterialSapService {
void warehousing(List<OutMaterialCompleteLog> outMaterialCompleteLogs, String site);
void saveMaterialCompleteData(List<OutMaterialCompleteLog> outMaterialCompleteLogs, String site);
}

View File

@ -15,7 +15,10 @@ 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.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.mom.common.core.constant.SecurityConstants;
import com.foreverwin.mom.common.core.util.R;
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
import com.foreverwin.mom.common.security.util.SecurityUtils;
@ -42,6 +45,7 @@ public class OutMaterialSapServiceImpl implements OutMaterialSapService {
private final RegisterDocumentService registerDocumentService;
private final RemoteWmsInventoryService remoteWmsInventoryService;
private final RemoteWmsInventoryRecordService remoteWmsInventoryRecordService;
private final RemoteWipService zLotMaterialCompleteTransactionService;
private final String messageId = "ZMM_MES_GOODSMVT_CREATE";
@ -432,16 +436,60 @@ public class OutMaterialSapServiceImpl implements OutMaterialSapService {
inventory.setOriginalQty(qtyDone);
inventory.setQtyOnHand(qtyDone);
inventory.setProductionDate(pdt);
inventory.setStatus("1001");
inventory.setQualityInspectionStatus(grade);
inventory.setRollType(uom);
inventory.setAuxiliaryUnit(subUom);
inventory.setAuxiliaryOty(String.valueOf(subQty));
if (!StringUtils.isEmpty(subUom)){
inventory.setAuxiliaryUnit(subUom);
}
if (subQty!=null) {
inventory.setAuxiliaryOty(String.valueOf(subQty));
}
inventories.add(inventory);
}
remoteWmsInventoryService.batchSave(inventories);
}
@Override
public void saveMaterialCompleteData(List<OutMaterialCompleteLog> outMaterialCompleteLogs, String site) {
Vector<ZLotMaterialCompleteTransaction> ZLotMaterialCompleteTransaction = new Vector<>();
for (OutMaterialCompleteLog outMaterialCompleteLog : outMaterialCompleteLogs) {
ZLotMaterialCompleteTransaction zLotMaterialCompleteTransaction = new ZLotMaterialCompleteTransaction();
zLotMaterialCompleteTransaction.setSite(site);
zLotMaterialCompleteTransaction.setFabNo(outMaterialCompleteLog.getFabNo());
zLotMaterialCompleteTransaction.setSid(UUID.randomUUID().toString());
zLotMaterialCompleteTransaction.setShopOrder(outMaterialCompleteLog.getShopOrder());
zLotMaterialCompleteTransaction.setLotNo(outMaterialCompleteLog.getLotNo());
zLotMaterialCompleteTransaction.setProductType(outMaterialCompleteLog.getProductType());
zLotMaterialCompleteTransaction.setErpItem(outMaterialCompleteLog.getErpItem());
zLotMaterialCompleteTransaction.setItem(outMaterialCompleteLog.getErpItem());
zLotMaterialCompleteTransaction.setErpInventory(outMaterialCompleteLog.getErpInventory());
zLotMaterialCompleteTransaction.setItemDesc(outMaterialCompleteLog.getItemDesc());
zLotMaterialCompleteTransaction.setMainQty(outMaterialCompleteLog.getMainQty());
zLotMaterialCompleteTransaction.setMainUom(outMaterialCompleteLog.getMainUom());
if (outMaterialCompleteLog.getSubQty() != null) {
zLotMaterialCompleteTransaction.setSubQty(outMaterialCompleteLog.getSubQty());
}
if (outMaterialCompleteLog.getSubUom() != null) {
zLotMaterialCompleteTransaction.setSubUom(outMaterialCompleteLog.getSubUom());
}
zLotMaterialCompleteTransaction.setQcGrade(outMaterialCompleteLog.getQcGrade());
zLotMaterialCompleteTransaction.setSyncPostingDate(outMaterialCompleteLog.getSyncPostingDate());
zLotMaterialCompleteTransaction.setSyncStatus("S");
zLotMaterialCompleteTransaction.setSyncSubmitter(SecurityUtils.getUserName());
zLotMaterialCompleteTransaction.setSyncVoucherNo(outMaterialCompleteLog.getSyncVoucherNo());
zLotMaterialCompleteTransaction.setDateCreate(LocalDateTime.now());
zLotMaterialCompleteTransaction.setCreator(SecurityUtils.getUserName());
zLotMaterialCompleteTransaction.setSyncMsgText("创建成功");
ZLotMaterialCompleteTransaction.add(zLotMaterialCompleteTransaction);
}
zLotMaterialCompleteTransactionService.remoteSaveOrUpdateBatchZLotMaterialCompleteTransaction(ZLotMaterialCompleteTransaction, SecurityConstants.FROM_IN);
}
}