库存分析 不判断数量
货架出入库加上库位信息 分解订单不判断数量 分拣完成后,更新出库单据信息
This commit is contained in:
1 parent
6a1329d74e
commit
54b51891a0
10 files changed
+117
-68
No files matched your search
@@ -255,9 +255,8 @@ namespace HHWMS.Web.Controllers
|
||||
var details = data.FirstOrDefault().ShipmentDetails.Where(x => x.Status < ShipStatusEnum.分配完成);
|
||||
foreach (var item in details)
|
||||
{
|
||||
var invQty = _unitwork.Find<Inventory>(x => x.UniqueCode.Equals(item.UniqueCode))
|
||||
.Sum(x => x.Qty);
|
||||
item.InventoryStatus = invQty >= (item.Qty - item.DividedQty) ? "满足" : "不足";
|
||||
var invQty = _unitwork.Find<Inventory>(x => x.UniqueCode.Equals(item.UniqueCode));
|
||||
item.InventoryStatus = invQty != null ? "满足" : "不足";
|
||||
}
|
||||
return JsonMore(details);
|
||||
}
|
||||
@@ -318,40 +317,42 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
shipment.UpdateBy = Wtm.LoginUserInfo.ITCode;
|
||||
shipment.UpdateTime = DateTime.Now;
|
||||
_unitwork.Update(shipment);
|
||||
|
||||
var ids = data.Select(x => x.ID).ToList();
|
||||
var invList = _unitwork.Find<Inventory>(x => ids.Contains(x.ID))
|
||||
.ToList();
|
||||
|
||||
if(ids.Count > 0) {
|
||||
var invList = _unitwork.Find<Inventory>(x => ids.Contains(x.ID))
|
||||
.ToList();
|
||||
|
||||
// 加入交易表
|
||||
var listInvtran = new List<InventoryTransaction>();
|
||||
foreach (var inv in invList)
|
||||
{
|
||||
listInvtran.Add(new InventoryTransaction
|
||||
// 加入交易表
|
||||
var listInvtran = new List<InventoryTransaction>();
|
||||
foreach (var inv in invList)
|
||||
{
|
||||
BillType = "out",
|
||||
ZoneCode = inv.ZoneCode,
|
||||
BillCode = shipment.Code,
|
||||
Type = inv.UniqueCode,
|
||||
MaterialCode = inv.MaterialCode,
|
||||
MaterialName = inv.MaterialName,
|
||||
MaterialSpec = inv.MaterialSpec,
|
||||
MaterialUnit = inv.MaterialUnit,
|
||||
MaterialType = inv.MaterialType,
|
||||
Batch = inv.Batch,
|
||||
Lot = inv.Lot,
|
||||
CompanyCode = inv.CompanyCode,
|
||||
LocationCode = inv.LocationCode,
|
||||
SupplierCode = inv.SupplierCode,
|
||||
Qty = inv.Qty,
|
||||
CreateTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
_unitwork.BatchAdd(listInvtran.ToArray());
|
||||
listInvtran.Add(new InventoryTransaction
|
||||
{
|
||||
BillType = "out",
|
||||
ZoneCode = inv.ZoneCode,
|
||||
BillCode = shipment.Code,
|
||||
Type = inv.UniqueCode,
|
||||
MaterialCode = inv.MaterialCode,
|
||||
MaterialName = inv.MaterialName,
|
||||
MaterialSpec = inv.MaterialSpec,
|
||||
MaterialUnit = inv.MaterialUnit,
|
||||
MaterialType = inv.MaterialType,
|
||||
Batch = inv.Batch,
|
||||
Lot = inv.Lot,
|
||||
CompanyCode = inv.CompanyCode,
|
||||
LocationCode = inv.LocationCode,
|
||||
SupplierCode = inv.SupplierCode,
|
||||
Qty = inv.Qty,
|
||||
CreateTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
_unitwork.BatchAdd(listInvtran.ToArray());
|
||||
|
||||
// 删除库存
|
||||
_unitwork.BatchDelete<Inventory>(x => data.Select(u => u.ID).Contains(x.ID));
|
||||
// 删除库存
|
||||
_unitwork.BatchDelete<Inventory>(x => data.Select(u => u.ID).Contains(x.ID));
|
||||
}
|
||||
return JsonMore(null);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user