feat(仪表盘): 添加任务历史、库位状态和当前任务统计图表

refactor(库存交易): 使用AutoMapper简化库存交易记录创建逻辑
This commit is contained in:
zhougf committed 2025-10-01 03:22:33 +08:00
1 parent d89f6ffb3e
commit 3cba19da98
5 files changed
+563 -203

No files matched your search

+14 -50
View File
@@ -394,61 +394,25 @@ namespace HHWMS.Web
if (task.TaskType != TaskTypeEnum.移库)
{
// 创建库存交易记录 放到任务完成,计算数量信息
var invTransaction = new InventoryTransaction
{
Type = task.TaskType == TaskTypeEnum.入库
? InventoryTranType.入库
: InventoryTranType.出库,
ContainerCode = task.ContainerCode,
LocationCode = task.ToLocation,
MaterialCode = inventory.MaterialCode,
MaterialType = inventory.MaterialType,
MaterialName = inventory.MaterialName,
MaterialSpec = inventory.MaterialSpec,
MaterialUnit = inventory.MaterialUnit,
Batch = inventory.Batch,
Qty = inventory.Qty,
Status = inventory.Status,
CreateTime = DateTime.Now
};
invTrans.Add(invTransaction);
var invTran = _mapper.Map<InventoryTransaction>(inventory);
invTran.Type = task.TaskType == TaskTypeEnum.入库
? InventoryTranType.入库
: InventoryTranType.出库;
invTrans.Add(invTran);
}
else
{
// 创建库存交易记录 放到任务完成,计算数量信息
var invTransaction = new InventoryTransaction
{
Type = InventoryTranType.入库,
ContainerCode = task.ContainerCode,
LocationCode = task.ToLocation,
MaterialCode = inventory.MaterialCode,
MaterialName = inventory.MaterialName,
MaterialSpec = inventory.MaterialSpec,
MaterialUnit = inventory.MaterialUnit,
MaterialType = inventory.MaterialType,
Batch = inventory.Batch,
Qty = inventory.Qty,
Status = inventory.Status,
CreateTime = DateTime.Now
};
invTrans.Add(invTransaction);
var invTran = _mapper.Map<InventoryTransaction>(inventory);
invTran.Type = InventoryTranType.入库;
var invTransaction2 = new InventoryTransaction
{
Type = InventoryTranType.出库,
ContainerCode = task.ContainerCode,
LocationCode = task.ToLocation,
MaterialCode = inventory.MaterialCode,
MaterialName = inventory.MaterialName,
MaterialSpec = inventory.MaterialSpec,
MaterialUnit = inventory.MaterialUnit,
MaterialType = inventory.MaterialType,
Batch = inventory.Batch,
Qty = inventory.Qty,
Status = inventory.Status,
CreateTime = DateTime.Now
};
invTrans.Add(invTransaction2);
invTrans.Add(invTran);
var invTran2 = _mapper.Map<InventoryTransaction>(inventory);
invTran2.Type = InventoryTranType.出库;
invTrans.Add(invTran2);
}
}