IQC检验结果部分NG时也只更新子库存条码

This commit is contained in:
彭枝刚 2024-12-16 10:46:22 +08:00
parent 877a1febad
commit 44bb84b448

View File

@ -6980,27 +6980,29 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
throw BusinessException.build("根据物料" + itemNo + "和批次" + sapBatch + "未找到库存数据");
}
for (Inventory inventory : wmsInventory) {
if (inventorys.contains(inventory.getInventoryId())) {
String srcQmsSpecialMarking = inventory.getQmsSpecialMarking();
inventory.setQmsSpecialMarking("5");
inventory.setUpdater(SecurityUtils.getUserName());
inventory.setUpdateTime(LocalDateTime.now());
inventoryService.updateById(inventory);
saveInventoryLog("IQC_BF", inventory, detailed.getDocumentNo(), inventory.getStatus(), inventory.getStatus(), "设定QmsSpecialMarking为5,原QmsSpecialMarking=" + srcQmsSpecialMarking, inventory.getQtyOnHand(), inventory.getQtyOnHand());
} else if ("6".equals(inventory.getQmsSpecialMarking())) {
BigDecimal srcQty = inventory.getQtyOnHand();
inventory.setQtyOnHand(BigDecimal.ZERO);
inventory.setUpdater(SecurityUtils.getUserName());
inventory.setUpdateTime(LocalDateTime.now());
inventoryService.updateById(inventory);
saveInventoryLog("IQC_BF", inventory, detailed.getDocumentNo(), inventory.getStatus(), inventory.getStatus(), "设定现有数量为0", srcQty, BigDecimal.ZERO);
} else {
String srcStatus = inventory.getStatus();
inventory.setStatus("1001");
inventory.setUpdater(SecurityUtils.getUserName());
inventory.setUpdateTime(LocalDateTime.now());
inventoryService.updateById(inventory);
saveInventoryLog("IQC_BF", inventory, detailed.getDocumentNo(), srcStatus, "1001", "设定状态为1001", inventory.getQtyOnHand(), inventory.getQtyOnHand());
if (inventory.getQtyOnHand().compareTo(BigDecimal.ZERO) > 0) {
if (inventorys.contains(inventory.getInventoryId())) {
String srcQmsSpecialMarking = inventory.getQmsSpecialMarking();
inventory.setQmsSpecialMarking("5");
inventory.setUpdater(SecurityUtils.getUserName());
inventory.setUpdateTime(LocalDateTime.now());
inventoryService.updateById(inventory);
saveInventoryLog("IQC_BF", inventory, detailed.getDocumentNo(), inventory.getStatus(), inventory.getStatus(), "设定QmsSpecialMarking为5,原QmsSpecialMarking=" + srcQmsSpecialMarking, inventory.getQtyOnHand(), inventory.getQtyOnHand());
} else if ("6".equals(inventory.getQmsSpecialMarking())) {
BigDecimal srcQty = inventory.getQtyOnHand();
inventory.setQtyOnHand(BigDecimal.ZERO);
inventory.setUpdater(SecurityUtils.getUserName());
inventory.setUpdateTime(LocalDateTime.now());
inventoryService.updateById(inventory);
saveInventoryLog("IQC_BF", inventory, detailed.getDocumentNo(), inventory.getStatus(), inventory.getStatus(), "设定现有数量为0", srcQty, BigDecimal.ZERO);
} else {
String srcStatus = inventory.getStatus();
inventory.setStatus("1001");
inventory.setUpdater(SecurityUtils.getUserName());
inventory.setUpdateTime(LocalDateTime.now());
inventoryService.updateById(inventory);
saveInventoryLog("IQC_BF", inventory, detailed.getDocumentNo(), srcStatus, "1001", "设定状态为1001", inventory.getQtyOnHand(), inventory.getQtyOnHand());
}
}
}
// 更新采购订单上的数量