Commit 4e5fb311 LN

库存报表数量错误问题修改

1 个父辈 d84cec98
...@@ -630,6 +630,36 @@ public class DataCache { ...@@ -630,6 +630,36 @@ public class DataCache {
} }
/** /**
* 手动修改数量的时候更新库存
* @param cid
* @param partNumber
* @param amount
* @return
*/
public int updateInAmount(String cid,String partNumber,int amount,String pn,String wcode){
if(amount != 0){
if(ObjectUtil.isEmpty(pn)){
pn="";
}
if(ObjectUtil.isEmpty(wcode)){
wcode="";
}
log.info("updateInAmount,直接更改库存="+amount+",不需要计算 : cid="+cid+",pn="+partNumber+",amount="+amount+",pn="+pn);
InventoryItem inventoryItem = getStorageInventoryByPartNumber(cid,partNumber);
if(inventoryItem == null){
inventoryItem = new InventoryItem();
inventoryItem.setPartNumber(partNumber);
inventoryItem.setWareHouseCode(wcode);
inventoryItem.setPartname(pn);
}
inventoryItem.setStockCount(amount);
inventoryItem.setStockReel(1);
updateStorageInventory(cid, inventoryItem);
return inventoryItem.getStockReel();
}
return -1;
}
/**
* 修改库存,出库为负,入库为正 * 修改库存,出库为负,入库为正
*/ */
public int updateInventory(StoragePos pos, Barcode barcode){ public int updateInventory(StoragePos pos, Barcode barcode){
......
...@@ -412,7 +412,7 @@ public class SpAgvDeviceClientController { ...@@ -412,7 +412,7 @@ public class SpAgvDeviceClientController {
for (Barcode subCode : subCodes) { for (Barcode subCode : subCodes) {
subCode.setStorageId(storage.getId()); subCode.setStorageId(storage.getId());
barcodeManager.save(subCode); barcodeManager.save(subCode);
dataCache.updateInventoryAmount(storage.getCid(), subCode.getPartNumber(), subCode.getAmount(),subCode.getPn(),storagePos.getWareHouseCode()); dataCache.updateInAmount(storage.getCid(), subCode.getPartNumber(), subCode.getAmount(),subCode.getPn(),storagePos.getWareHouseCode());
} }
} }
barcode.setSubCodeList(subCodes); barcode.setSubCodeList(subCodes);
...@@ -473,7 +473,7 @@ public class SpAgvDeviceClientController { ...@@ -473,7 +473,7 @@ public class SpAgvDeviceClientController {
if (subCodes != null && !subCodes.isEmpty()) { if (subCodes != null && !subCodes.isEmpty()) {
Storage storage = dataCache.getStorageById(storagePos.getStorageId()); Storage storage = dataCache.getStorageById(storagePos.getStorageId());
for (Barcode subCode : subCodes) { for (Barcode subCode : subCodes) {
dataCache.updateInventoryAmount(storage.getCid(), subCode.getPartNumber(), -subCode.getAmount(),subCode.getPn(),storagePos.getWareHouseCode()); dataCache.updateInAmount(storage.getCid(), subCode.getPartNumber(), subCode.getAmount(),subCode.getPn(),storagePos.getWareHouseCode());
} }
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!