添加客户管理

修改入库页面
修改 库存 物料 工序等页面
This commit is contained in:
zhougf committed 2025-07-25 04:35:31 +08:00
1 parent 2435176f77
commit c2b039ea47
41 files changed
+977 -160

No files matched your search

@@ -130,6 +130,10 @@ namespace HHWMS.Web.Controllers
{
return Json(new { Code = 500, Msg = "物料不存在" });
}
if (material.Qty == null || material.Qty <= 0)
{
return Json(new { Code = 500, Msg = "物料毛重没有设置,请设置后再执行入库" });
}
// 获取容器信息
var container = _unitWork.FindSingle<Container>(c => c.Code == model.PalletCode);
@@ -137,19 +141,24 @@ namespace HHWMS.Web.Controllers
{
return Json(new { Code = 500, Msg = "容器不存在" });
}
// 从字典查询工序对应的区域
var processName = _unitWork.FindSingle<SysDictData>(x => x.DictType == "ProcessZone"
&& x.DictLabel == model.ProcessName)?.DictValue;
if (string.IsNullOrEmpty(processName))
var materialProcess = _unitWork.FindSingle<MaterialProcess>(m => m.ID == model.ProcessId);
if (materialProcess == null)
{
return Json(new { Code = 500, Msg = "未找到此工序配置" });
}
// 从字典查询工序对应的区域
var zoneName = _unitWork.FindSingle<SysDictData>(x => x.DictType == "ProcessZone"
&& x.DictLabel == materialProcess.ProcessCode)?.DictValue;
if (string.IsNullOrEmpty(zoneName))
{
return Json(new { Code = 500, Msg = "未找到此工序对应区域配置" });
}
// 1. 查找可用库位信息
var locationVm = Wtm.CreateVM<LocationVM>();
var locationCode = locationVm.GetEmptyLocationFromXb(_materialZones[processName].BeginLine, _materialZones[processName].EndLine);
var locationCode = locationVm.GetEmptyLocationFromXb(_materialZones[zoneName].BeginLine, _materialZones[zoneName].EndLine);
if (string.IsNullOrWhiteSpace(locationCode))
{
@@ -187,13 +196,17 @@ namespace HHWMS.Web.Controllers
ContainerCode = model.PalletCode,
LocationCode = locationCode,
MaterialCode = model.MaterialCode,
MaterialType = material.MaterialType,
MaterialName = material.MaterialName,
MaterialSpec = material.MaterialSpec,
MaterialUnit = material.MaterialUnit,
Batch = model.ProcessName,
Lot = model.ProcessId.ToString(),
Batch = materialProcess.ProcessName,
Lot = materialProcess.ProcessCode,
Status = model.IsQualified ? "合格" : "不合格",
TaskStatus = InventoryTaskStatusEnum.Locked,
TaskQty = model.Qty,
CreateBy = model.OperatorId,
ReceiptCode = model.OperatorInfo, //校验员
CreateTime = DateTime.Now
};
@@ -236,11 +249,16 @@ namespace HHWMS.Web.Controllers
};
// 调用WCS任务下发接口
// tran.Commit();
// return Json(new { Code = 200, Msg = "入库成功", Data = new { TaskNo = taskNo } });
var wcsResult = Wtm.CallAPI<WCSTaskResponse>("WCSXB", "TaskAssign", HttpMethodEnum.POST, wcsTaskModel).Result.Data;
if (wcsResult != null && wcsResult.Success)
{
// WCS任务下发成功,提交事务
taskHeader.Status = TaskStatusEnum.已下发;
_unitWork.Update(taskHeader);
tran.Commit();
return Json(new { Code = 200, Msg = "入库成功", Data = new { TaskNo = taskNo } });
}
@@ -387,6 +405,7 @@ namespace HHWMS.Web.Controllers
.Select(m => new
{
MaterialCode = m.MaterialCode,
m.MaterialType,
MaterialName = m.MaterialName
})
.Take(10)
@@ -411,7 +430,7 @@ namespace HHWMS.Web.Controllers
public string OperatorId { get; set; }
public int ProcessId { get; set; }
public string ProcessName { get; set; }
public int Qty { get; set; }
public bool IsQualified { get; set; }
public string OperatorInfo { get; set; }
}