力阔现场出入库流程
agv任务下发 修改部分实体类错误和页面字段等 layout 添加条码库 添加容器逻辑修改
This commit is contained in:
1 parent
345b5a3d5b
commit
b4632cfc33
29 files changed
+618
-849
No files matched your search
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
using HHWMS.Web.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
@@ -5,14 +7,14 @@ using WalkingTec.Mvvm.Mvc;
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
[Area("receipt")]
|
||||
[ActionDescription("盘料操作")]
|
||||
[ActionDescription("入库操作")]
|
||||
public partial class ReceiptInController : BaseController
|
||||
{
|
||||
private readonly IUnitWork _unitWork;
|
||||
|
||||
public ReceiptInController(IUnitWork unitwork)
|
||||
public ReceiptInController(IUnitWork unitWork)
|
||||
{
|
||||
_unitWork = unitwork;
|
||||
_unitWork = unitWork;
|
||||
}
|
||||
|
||||
#region Index
|
||||
@@ -24,5 +26,77 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
|
||||
#endregion Index
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult TaskIn(string containerCode)
|
||||
{
|
||||
// 判断containerCode是否为空
|
||||
if (string.IsNullOrEmpty(containerCode))
|
||||
{
|
||||
return JsonMore(null, 500, "容器编码为空!请检查后重新提交!");
|
||||
}
|
||||
// 查询container表code为containercode的值
|
||||
var container = _unitWork.FindSingle<Container>(u => u.Code == containerCode);
|
||||
if (container == null)
|
||||
{
|
||||
return JsonMore(null, 500, $"库内没有编码为 {containerCode} 的容器!");
|
||||
}
|
||||
|
||||
container.IsLock = ContainerLockEnum.任务锁;
|
||||
container.UpdateTime = DateTime.Now;
|
||||
container.UpdateBy = Wtm.LoginUserInfo?.ITCode??"WMS";
|
||||
_unitWork.Update(container);
|
||||
|
||||
//查询location表的一个空库位 更新仓位状态为锁定
|
||||
var location = _unitWork.FindSingle<Location>(u => u.Status == LocationStatus.空仓位);
|
||||
// 判断location是否为空
|
||||
if (location == null)
|
||||
{
|
||||
return JsonMore(null, 500, "库内没有空闲仓位!");
|
||||
}
|
||||
location.Status = LocationStatus.任务锁;
|
||||
location.UpdateTime = DateTime.Now;
|
||||
location.UpdateBy = Wtm.LoginUserInfo?.ITCode??"WMS";
|
||||
_unitWork.Update(location);
|
||||
|
||||
//创建容器编码为containercode的任务
|
||||
var task = new TaskHeader
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.立库,
|
||||
TaskNo = _unitWork.GetSerialNumber("In"),
|
||||
TaskType = TaskTypeEnum.立库入库,
|
||||
ContainerCode = containerCode,
|
||||
FromLocation = "",
|
||||
ToLocation = location.Code,
|
||||
Status = TaskStatusEnum.待下发,
|
||||
CreateBy = Wtm.LoginUserInfo?.ITCode??"WMS",
|
||||
CreateTime = DateTime.Now
|
||||
};
|
||||
_unitWork.Add(task);
|
||||
|
||||
// 下发任务到wcs
|
||||
var postData = new
|
||||
{
|
||||
TaskNo = task.TaskNo,
|
||||
PalletNo = task.ContainerCode,
|
||||
FromLocation = task.FromLocation,
|
||||
ToLocation = task.ToLocation
|
||||
};
|
||||
var res1 = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, postData);
|
||||
var res = res1.Result.Data;
|
||||
if (res.Success)
|
||||
{
|
||||
task.Status = TaskStatusEnum.已下发;
|
||||
}
|
||||
else
|
||||
{
|
||||
task.ErrorMsg = res.Msg;
|
||||
}
|
||||
task.UpdateTime = DateTime.Now;
|
||||
task.UpdateBy = "WMS";
|
||||
_unitWork.Update(task);
|
||||
|
||||
return JsonMore(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user