Compare commits

...
6 Commits
Author SHA1 Message Date
zhougf a3e91357ee 容器出库
库位禁用
演示逻辑修改 task station=1的出库任务需要自动下发入库任务和AGv任务
2024-05-29 17:09:03 +08:00
zhougf a6168a75bf 设计出库口入库流程
托盘、周转箱分区存放
2024-04-30 23:18:05 +08:00
zhougf 70e6866e20 现场初始调试完成,
入库(有货/空容器)
出库,库存出库
AGV任务对接
2024-04-24 10:51:58 +08:00
zhougf b4632cfc33 力阔现场出入库流程
agv任务下发
修改部分实体类错误和页面字段等
layout 添加条码库
添加容器逻辑修改
2024-04-21 22:03:15 +08:00
zhougf 345b5a3d5b Merge branch 'master' into lkwms 2024-04-17 12:03:18 +08:00
zhougf f8e5ea23a9 基础修改 2024-04-17 11:46:50 +08:00
35 changed files with 1059 additions and 898 deletions

No files matched your search

+3 -3
View File
@@ -8,12 +8,12 @@ namespace HHWMS.Web
{ {
protected JsonResult ApiResult(object data = null, string msg = "success") protected JsonResult ApiResult(object data = null, string msg = "success")
{ {
return new JsonResult(new ApiJsonResult<object> { Data = data, Success = true, Status = true, Msg = msg }); return new JsonResult(new ApiJsonResult<object> { Data = data, Success = true, Msg = msg });
} }
protected JsonResult ApiResultError(object data = null, string msg = "faield") protected JsonResult ApiResultError(object data = null, string msg = "failed")
{ {
return new JsonResult(new ApiJsonResult<object> { Data = data, Success = false, Status = false, Msg = msg }); return new JsonResult(new ApiJsonResult<object> { Data = data, Success = false, Msg = msg });
} }
} }
} }
+225 -56
View File
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using AutoMapper; using AutoMapper;
using HHWMS.Web.Controllers;
using HHWMS.Web.Models; using HHWMS.Web.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
@@ -9,7 +11,7 @@ using WalkingTec.Mvvm.Core;
namespace HHWMS.Web namespace HHWMS.Web
{ {
/// <summary> /// <summary>
/// WCS接口 /// 提供WCS调用接口
/// 调用方向 WCS --> WMS /// 调用方向 WCS --> WMS
/// </summary> /// </summary>
[Public] [Public]
@@ -18,74 +20,241 @@ namespace HHWMS.Web
[Route("api/[controller]/[action]"), ApiExplorerSettings(GroupName = "User")] [Route("api/[controller]/[action]"), ApiExplorerSettings(GroupName = "User")]
public class IWCSController : ApiController public class IWCSController : ApiController
{ {
private readonly IUnitWork _unitwork; private readonly IUnitWork _unitWork;
private readonly IMapper _mapper; private readonly IMapper _mapper;
public IWCSController(IUnitWork unitwork, IMapper mapper) public IWCSController(IUnitWork unitWork, IMapper mapper)
{ {
_unitwork = unitwork; _unitWork = unitWork;
_mapper = mapper; _mapper = mapper;
} }
/// <summary>
/// 请求入库
/// </summary>
/// <returns></returns>
[HttpPost]
public IActionResult RequestIn(WcsRequest request)
{
//var inv = new List<Inventory>();
//for (int i = 0; i < 10; i++)
// inv.Add(new Inventory
// {
// ContainerCode = "test" + i
// });
//_unitwork.BatchAdd<Inventory>(inv);
//_unitwork.DeleteById<Inventory>(1441);
//_unitwork.BatchUpdate<Inventory>(x => x.ID > 1030, x=>new Inventory { Batch = "test"});
// 测试 删除数据 保存到历史表 主子表数据
/*var receipt = _unitwork.Find<ReceiptHeader>(x => x.ID == 3)
.FirstOrDefault();
var details = _unitwork.Find<ReceiptDetail>(x => x.HeaderId == 3)
.ToArray();
var his = _mapper.Map<ReceiptHeaderHistory>(receipt);
var his2 = _mapper.Map<ReceiptDetail[], IEnumerable<ReceiptDetailHistory>>(details);
_unitwork.Add(his);
_unitwork.BatchAdd(his2);*/
/*var receipt = _unitwork.Find<ShipmentHeader>(x => x.ID == 3)
.FirstOrDefault();
var details = _unitwork.Find<ShipmentDetail>(x => x.HeaderId == 3)
.ToArray();
var his = _mapper.Map<ShipmentHeaderHistory>(receipt);
var his2 = _mapper.Map<ShipmentDetail[], IEnumerable<ShipmentDetailHistory>>(details);
_unitwork.Add(his);
_unitwork.BatchAdd(his2);*/
var receipt = _unitwork.Find<TaskHeader>(x => 1==1)
.FirstOrDefault();
var details = _unitwork.Find<TaskDetail>(x => x.HeaderId == receipt.ID)
.ToArray();
var his = _mapper.Map<TaskHeaderHistory>(receipt);
var his2 = _mapper.Map<TaskDetail[], IEnumerable<TaskDetailHistory>>(details);
_unitwork.Add(his);
_unitwork.BatchAdd(his2);
return ApiResult();
}
/// <summary> /// <summary>
/// 状态返回 /// 状态返回
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public IActionResult TaskStatusResult(WcsRequest request) public IActionResult ReturnStatus(WcsRequest request)
{ {
// 返回状态 只接收100
if (request.State != 100)
{
return ApiResultError(msg: "State 不为100, 请检查后重新请求!");
}
// 判断任务是否合理
var task = _unitWork.FindSingle<TaskHeader>(x => x.TaskNo.Equals(request.TaskNo));
if (task == null)
{
return ApiResultError(msg: $"任务不存在, 任务号 {request.TaskNo} , 请检查后重新请求!");
}
// 根据任务类型 入/出 处理不同流程
switch (task.TaskType)
{
case TaskTypeEnum.立库入库:
// 1.更新库存
_unitWork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode), x => new Inventory
{
UpdateTime = DateTime.Now,
UpdateBy = "WMS",
TaskStatus = InventoryTaskStatus.无任务
});
// 2.更新容器
_unitWork.BatchUpdate<Container>(x => x.Code.Equals(task.ContainerCode), x => new Container
{
UpdateTime = DateTime.Now,
UpdateBy = "WMS",
IsLock = ContainerLockEnum.未锁,
LocationCode = task.ToLocation
});
var inventoryList = _unitWork.Find<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode))
.ToList();
// 3.更新库位
_unitWork.BatchUpdate<Location>(x => x.Code.Equals(task.ToLocation), x => new Location
{
UpdateTime = DateTime.Now,
UpdateBy = "WMS",
Status = inventoryList.Count > 0 ? LocationStatus.有货 : LocationStatus.空容器,
ContainerCode = task.ContainerCode
});
// 4.插入库存交易
// 1.将任务容器的库存查出来
if (inventoryList.Count > 0)
{
// 2.根据库存生成库存交易出库信息
var inventoryTransactions = inventoryList.Select(inventory => new InventoryTransaction
{
BillType = InventoryTranType.入库,
MaterialCode = inventory.MaterialCode,
MaterialName = inventory.MaterialName,
MaterialUnit = inventory.MaterialUnit,
Batch = inventory.Batch,
Lot = inventory.Lot,
LocationCode = inventory.LocationCode,
ContainerCode = inventory.ContainerCode,
Qty = inventory.Qty,
CreateTime = DateTime.Now,
CreateBy = "WMS",
UpdateTime = DateTime.Now,
UpdateBy = "WMS"
}).ToList();
// 3.批量插入库存交易
_unitWork.BatchAdd(inventoryTransactions);
}
break;
case TaskTypeEnum.立库出库:
_unitWork.BatchUpdate<Container>(x => x.Code.Equals(task.ContainerCode), x => new Container
{
UpdateTime = DateTime.Now,
UpdateBy = "WMS",
IsLock = ContainerLockEnum.未锁,
LocationCode = ""
});
_unitWork.BatchUpdate<Location>(x => x.Code.Equals(task.FromLocation), x => new Location
{
UpdateTime = DateTime.Now,
UpdateBy = "WMS",
Status = LocationStatus.空仓位,
ContainerCode = ""
});
// 1.将任务容器的库存查出来
var inventoryList2 = _unitWork.Find<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode))
.ToList();
if (inventoryList2.Count > 0)
{
// 2.根据库存生成库存交易出库信息
var inventoryTransactions2 = inventoryList2.Select(inventory => new InventoryTransaction
{
BillType = InventoryTranType.出库,
MaterialCode = inventory.MaterialCode,
MaterialName = inventory.MaterialName,
MaterialUnit = inventory.MaterialUnit,
Batch = inventory.Batch,
Lot = inventory.Lot,
LocationCode = inventory.LocationCode,
ContainerCode = inventory.ContainerCode,
Qty = inventory.Qty,
CreateTime = DateTime.Now,
CreateBy = "WMS",
UpdateTime = DateTime.Now,
UpdateBy = "WMS"
}).ToList();
// 3.批量插入库存交易
_unitWork.BatchAdd(inventoryTransactions2);
_unitWork.BatchDelete<Inventory>(inventoryList2);
}
// 如果是出库页面创建的任务,则创建入库任务并联动AGV
if (task.Station == "1")
{
new ReceiptInController(_unitWork, Wtm).TaskIn(task.ContainerCode, false, false);
// 下发AGV到出库口的任务
var agv_task_id = Wtm.ConfigInfo.AppSettings.FirstOrDefault(x => x.Key == "OutIn").Value;
var postAgv = new
{
task_id = agv_task_id,
};
var res = Wtm.CallAPI<ShipOutController.agvResult>("ACS", "task_mould_do",
HttpMethodEnum.POST, postAgv);
// if (res.Result.Data.ack == 0)
// {
//
// }
}
break;
default:
return ApiResultError(msg: $"任务类型不正确!任务号{request.TaskNo}");
}
task.Status = TaskStatusEnum.完成;
// 插到历史表,或者接下来流程
_unitWork.Add(new TaskHeaderHistory
{
TaskNo = task.TaskNo,
TaskType = task.TaskType,
FromLocation = task.FromLocation,
ToLocation = task.ToLocation,
ContainerCode = task.ContainerCode,
Status = task.Status,
CreateTime = DateTime.Now,
CreateBy = "WMS"
});
_unitWork.Delete(task);
return ApiResult(); return ApiResult();
} }
/// <summary>
/// 满入
/// </summary>
/// <returns></returns>
[HttpPost]
public IActionResult FullIn(WcsRequest request)
{
var task = _unitWork.FindSingle<TaskHeader>(x => x.TaskNo.Equals(request.TaskNo));
if (task == null)
{
return ApiResultError(msg: $"任务不存在, 任务号 {request.TaskNo} , 请检查后重新请求!");
}
var location = _unitWork.FindSingle<Location>(x => x.Status == LocationStatus.空仓位);
if (location == null)
{
return ApiResultError(msg: "没有空仓位");
}
task.ToLocation = location.Code;
_unitWork.Update(task);
location.Status = LocationStatus.任务锁;
_unitWork.Update(location);
return ApiResult(new
{
locationCode = location.Code
});
}
/// <summary>
/// 空出
/// </summary>
/// <returns></returns>
[HttpPost]
public IActionResult EmptyOut(WcsRequest request)
{
var task = _unitWork.FindSingle<TaskHeader>(x => x.TaskNo.Equals(request.TaskNo));
if (task == null)
{
return ApiResultError(msg: $"任务不存在, 任务号 {request.TaskNo} , 请检查后重新请求!");
}
_unitWork.Add(new TaskHeaderHistory
{
TaskNo = task.TaskNo,
TaskType = task.TaskType,
FromLocation = task.FromLocation,
ToLocation = task.ToLocation,
ContainerCode = task.ContainerCode,
Status = task.Status,
CreateTime = DateTime.Now,
CreateBy = "WMS"
});
_unitWork.Delete(task);
return ApiResult();
}
} }
} }
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using HHWMS.Web.Models; using HHWMS.Web.Models;
@@ -265,8 +266,10 @@ namespace HHWMS.Web.Controllers
vm.MSD.AddModelError(vm.Entity.BatchError, "数量和类型必填,且数量要大于0!"); vm.MSD.AddModelError(vm.Entity.BatchError, "数量和类型必填,且数量要大于0!");
return PartialView(vm); return PartialView(vm);
} }
var maxContainer = _unitwork.Find<Container>(x => x.Type == vm.Entity.Type).ToList().MaxBy(x => x.Code); var maxContainer = _unitwork.Find<Container>(x => x.Type == vm.Entity.Type)
int maxNum = 1; .ToList()
.MaxBy(x => x.Code);
int maxNum = 0;
if (maxContainer != null) if (maxContainer != null)
int.TryParse(maxContainer?.Code.Substring(1, 4), out maxNum); int.TryParse(maxContainer?.Code.Substring(1, 4), out maxNum);
// 查询已有的最大托盘值 在此基础上累加 // 查询已有的最大托盘值 在此基础上累加
@@ -288,5 +291,89 @@ namespace HHWMS.Web.Controllers
return FFResult().CloseDialog().RefreshGrid(); return FFResult().CloseDialog().RefreshGrid();
} }
} }
[ActionDescription("Inventory.Out")]
public IActionResult Out(int id)
{
var container = _unitwork.FindById<Container>(id);
if (container == null)
{
return FFResult().RefreshGrid().Alert("选定容器不存在!请检查后再执行出库任务!");
}
if (string.IsNullOrEmpty(container.LocationCode))
{
return FFResult().RefreshGrid().Alert("选定容器不在库位!请检查后再执行出库任务!");
}
if (_unitwork.IsExit<TaskHeader>(x => x.ContainerCode.Equals(container.Code)))
{
return FFResult().RefreshGrid().Alert("选定容器已存在任务!请检查后再执行出库任务!");
}
var location = _unitwork.FindSingle<Location>(x => x.Code == container.LocationCode);
if (location != null)
{
location.Status = LocationStatus.任务锁;
location.UpdateTime = DateTime.Now;
location.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
_unitwork.Update(location);
// 查找container,并更新状态
// var container = _unitwork.FindSingle<Container>(x => x.Code == location.ContainerCode);
container.IsLock = ContainerLockEnum.任务锁;
container.UpdateTime = DateTime.Now;
container.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
_unitwork.Update(container);
//创建出库任务
var task = new TaskHeader
{
ZoneCode = ZoneCodeEnum.立库,
TaskNo = _unitwork.GetSerialNumber("Out"),
TaskType = TaskTypeEnum.立库出库,
ContainerCode = location.ContainerCode,
FromLocation = location.Code,
ToLocation = "",
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
};
try
{
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, postData)
.Result.Data;
if (res.Success)
{
task.Status = TaskStatusEnum.已下发;
}
else
{
task.ErrorMsg = res.Msg;
}
}
catch (Exception ex)
{
task.ErrorMsg = ex.Message;
}
task.UpdateTime = DateTime.Now;
task.UpdateBy = "WMS";
_unitwork.Update(task);
}
return FFResult().RefreshGrid().Message("任务创建成功!");
}
} }
} }
@@ -6,6 +6,7 @@ using WalkingTec.Mvvm.Mvc;
using WalkingTec.Mvvm.Core.Extensions; using WalkingTec.Mvvm.Core.Extensions;
using HHWMS.Web; using HHWMS.Web;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using HHWMS.Web.Models; using HHWMS.Web.Models;
namespace HHWMS.Web.Controllers namespace HHWMS.Web.Controllers
@@ -287,5 +288,30 @@ namespace HHWMS.Web.Controllers
return Ok(); return Ok();
} }
[ActionDescription("Location.StopLocation")]
public ActionResult StopLocation(string[] ids)
{
_unitwork.BatchUpdate<Location>(x => ids.Contains(x.ID.ToString()),
x => new Location
{
IsStop = true,
UpdateBy = Wtm.LoginUserInfo.ITCode,
UpdateTime = DateTime.Now
});
return FFResult().RefreshGrid().Message("库位禁用成功!");
}
[ActionDescription("Location.LiftLocation")]
public ActionResult LiftLocation(string[] ids)
{
_unitwork.BatchUpdate<Location>(x => ids.Contains(x.ID.ToString()),
x => new Location
{
IsStop = false,
UpdateBy = Wtm.LoginUserInfo.ITCode,
UpdateTime = DateTime.Now
});
return FFResult().RefreshGrid().Message("库位解禁成功!");
}
} }
} }
@@ -31,6 +31,10 @@ namespace HHWMS.Web
this.MakeStandardAction("Container", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800), this.MakeStandardAction("Container", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
this.MakeStandardAction("Container", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"), this.MakeStandardAction("Container", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
this.MakeAction("Container","AddContainer",Localizer["Container.AddContainer"],Localizer["Container.AddContainer"],GridActionParameterTypesEnum.NoId,"configs"), this.MakeAction("Container","AddContainer",Localizer["Container.AddContainer"],Localizer["Container.AddContainer"],GridActionParameterTypesEnum.NoId,"configs"),
this.MakeAction("Container","Out",Localizer["Inventory.Out"],Localizer["Inventory.Out"],GridActionParameterTypesEnum.SingleId,"configs"),
this.MakeAction("Location","Print",Localizer["Sys.Print"],Localizer["Sys.Print"],GridActionParameterTypesEnum.MultiIds,"configs")
.SetShowDialog(false).SetOnClickScript("print"),
}; };
} }
@@ -33,6 +33,9 @@ namespace HHWMS.Web
this.MakeStandardAction("Location", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800), this.MakeStandardAction("Location", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
this.MakeStandardAction("Location", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"), this.MakeStandardAction("Location", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
this.MakeAction("Location","AddLocation",Localizer["Location.AddLocation"],Localizer["Location.AddLocation"],GridActionParameterTypesEnum.NoId,"configs"), this.MakeAction("Location","AddLocation",Localizer["Location.AddLocation"],Localizer["Location.AddLocation"],GridActionParameterTypesEnum.NoId,"configs"),
this.MakeAction("Location","StopLocation",Localizer["Location.StopLocation"],Localizer["Location.StopLocation"],GridActionParameterTypesEnum.MultiIds,"configs"),
this.MakeAction("Location","LiftLocation",Localizer["Location.LiftLocation"],Localizer["Location.LiftLocation"],GridActionParameterTypesEnum.MultiIds,"configs"),
this.MakeAction("Location","Print",Localizer["Sys.Print"],Localizer["Sys.Print"],GridActionParameterTypesEnum.MultiIds,"configs") this.MakeAction("Location","Print",Localizer["Sys.Print"],Localizer["Sys.Print"],GridActionParameterTypesEnum.MultiIds,"configs")
.SetShowDialog(false).SetOnClickScript("print"), .SetShowDialog(false).SetOnClickScript("print"),
@@ -12,12 +12,6 @@ namespace HHWMS.Web
{ {
public partial class MaterialTemplateVM : BaseTemplateVM public partial class MaterialTemplateVM : BaseTemplateVM
{ {
[Display(Name = "Inventory.UniqueCode")]
public ExcelPropety UniqueCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.UniqueCode);
[Display(Name = "Inventory.QRCode")]
public ExcelPropety QRCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.QRCode);
[Display(Name = "Inventory.SourceCode")]
public ExcelPropety SourceCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.SourceCode);
[Display(Name = "Inventory.MaterialCode")] [Display(Name = "Inventory.MaterialCode")]
public ExcelPropety MaterialCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.MaterialCode); public ExcelPropety MaterialCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.MaterialCode);
[Display(Name = "Inventory.MaterialType")] [Display(Name = "Inventory.MaterialType")]
@@ -32,9 +32,6 @@ namespace HHWMS.Web
protected override IEnumerable<IGridColumn<Material_View>> InitGridHeader() protected override IEnumerable<IGridColumn<Material_View>> InitGridHeader()
{ {
return new List<GridColumn<Material_View>>{ return new List<GridColumn<Material_View>>{
this.MakeGridHeader(x => x.UniqueCode).SetHide(),
this.MakeGridHeader(x => x.QRCode),
this.MakeGridHeader(x => x.SourceCode).SetHide(),
this.MakeGridHeader(x => x.MaterialCode), this.MakeGridHeader(x => x.MaterialCode),
this.MakeGridHeader(x => x.MaterialType), this.MakeGridHeader(x => x.MaterialType),
this.MakeGridHeader(x => x.MaterialName), this.MakeGridHeader(x => x.MaterialName),
@@ -52,15 +49,10 @@ namespace HHWMS.Web
public override IOrderedQueryable<Material_View> GetSearchQuery() public override IOrderedQueryable<Material_View> GetSearchQuery()
{ {
var query = DC.Set<Material>() var query = DC.Set<Material>()
.CheckContain(Searcher.UniqueCode, x=>x.UniqueCode)
.CheckContain(Searcher.QRCode, x=>x.QRCode)
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode) .CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
.Select(x => new Material_View .Select(x => new Material_View
{ {
ID = x.ID, ID = x.ID,
UniqueCode = x.UniqueCode,
QRCode = x.QRCode,
SourceCode = x.SourceCode,
MaterialCode = x.MaterialCode, MaterialCode = x.MaterialCode,
MaterialType = x.MaterialType, MaterialType = x.MaterialType,
MaterialName = x.MaterialName, MaterialName = x.MaterialName,
@@ -12,10 +12,6 @@ namespace HHWMS.Web
{ {
public partial class MaterialSearcher : BaseSearcher public partial class MaterialSearcher : BaseSearcher
{ {
[Display(Name = "Inventory.UniqueCode")]
public String UniqueCode { get; set; }
[Display(Name = "Inventory.QRCode")]
public String QRCode { get; set; }
[Display(Name = "Inventory.MaterialCode")] [Display(Name = "Inventory.MaterialCode")]
public String MaterialCode { get; set; } public String MaterialCode { get; set; }
@@ -3,7 +3,7 @@
<wt:form vm="@Model"> <wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two"> <wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="Entity.Type" /> <wt:combobox field="Entity.Type" items="ContainerType"/>
<wt:textbox field="Num" /> <wt:textbox field="Num" />
<wt:textbox field="Entity.Length" /> <wt:textbox field="Entity.Length" />
<wt:textbox field="Entity.Width" /> <wt:textbox field="Entity.Width" />
@@ -14,3 +14,20 @@
</wt:row> </wt:row>
</wt:searchpanel> </wt:searchpanel>
<wt:grid vm="@Model" url="/configs/Container/Search"/> <wt:grid vm="@Model" url="/configs/Container/Search"/>
<script>
let template = {"panels":[{"index":0,"height":60,"width":80,"paperHeader":43.5,"paperFooter":170.07874015748033,"printElements":[{"options":{"left":13.5,"top":22.5,"height":100.5,"width":198,"title":"12345678","field":"code","testData":"12345678","textType":"barcode","barcodeMode":"CODE128A","fontFamily":"Microsoft YaHei","fontSize":20.25,"textAlign":"center","lineHeight":30},"printElementType":{"type":"text"}}],"paperNumberLeft":196,"paperNumberTop":148,"paperNumberDisabled":true}]};
let printData = [];
function print(ids, datas) {
datas.forEach(function (value, index, arr) {
printData.push({ code: value.Code })
});
hiprint.init();
var hiprintTemplate = new hiprint.PrintTemplate({
template: template
});
hiprintTemplate.print(printData);
printData = [];
}
</script>
@@ -5,15 +5,17 @@
<wt:row items-per-row="ItemsPerRowEnum.Three"> <wt:row items-per-row="ItemsPerRowEnum.Three">
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" /> <wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
<wt:textbox field="Searcher.Code" /> <wt:textbox field="Searcher.Code" />
@* <wt:combobox field="Searcher.Type" items="Types" /> <wt:combobox field="Searcher.Type" items="Types" />
<wt:combobox field="Searcher.Status" items="LocationStatus" /> <wt:combobox field="Searcher.Status" items="LocationStatus" />
<wt:textbox field="Searcher.ContainerCode" />
<wt:combobox field="Searcher.IsStop" empty-text="@Localizer["Sys.All"]" />
<wt:textbox field="Searcher.Row" /> <wt:textbox field="Searcher.Row" />
<wt:textbox field="Searcher.Line" /> <wt:textbox field="Searcher.Line" />
<wt:textbox field="Searcher.Layer" /> <wt:textbox field="Searcher.Layer" />
@*
<wt:textbox field="Searcher.RoadWay" /> <wt:textbox field="Searcher.RoadWay" />
<wt:textbox field="Searcher.ContainerCode" /> <wt:textbox field="Searcher.ContiguousCode" />
<wt:combobox field="Searcher.IsStop" empty-text="@Localizer["Sys.All"]" /> *@ *@
@*<wt:textbox field="Searcher.ContiguousCode" />*@
</wt:row> </wt:row>
</wt:searchpanel> </wt:searchpanel>
<wt:grid vm="@Model" url="/configs/Location/Search"/> <wt:grid vm="@Model" url="/configs/Location/Search"/>
@@ -3,9 +3,6 @@
<wt:form vm="@Model"> <wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two"> <wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="Entity.UniqueCode" />
<wt:textbox field="Entity.QRCode" />
<wt:textbox field="Entity.SourceCode" />
<wt:textbox field="Entity.MaterialCode" /> <wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" /> <wt:textbox field="Entity.MaterialType" />
<wt:textbox field="Entity.MaterialName" /> <wt:textbox field="Entity.MaterialName" />
@@ -4,9 +4,6 @@
<wt:form vm="@Model"> <wt:form vm="@Model">
<wt:quote>@Localizer["Sys.DeleteConfirm"]</wt:quote> <wt:quote>@Localizer["Sys.DeleteConfirm"]</wt:quote>
<wt:row items-per-row="ItemsPerRowEnum.Two"> <wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.UniqueCode" />
<wt:display field="Entity.QRCode" />
<wt:display field="Entity.SourceCode" />
<wt:display field="Entity.MaterialCode" /> <wt:display field="Entity.MaterialCode" />
<wt:display field="Entity.MaterialType" /> <wt:display field="Entity.MaterialType" />
<wt:display field="Entity.MaterialName" /> <wt:display field="Entity.MaterialName" />
@@ -3,9 +3,6 @@
<wt:form vm="@Model"> <wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two"> <wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.UniqueCode" />
<wt:display field="Entity.QRCode" />
<wt:display field="Entity.SourceCode" />
<wt:display field="Entity.MaterialCode" /> <wt:display field="Entity.MaterialCode" />
<wt:display field="Entity.MaterialType" /> <wt:display field="Entity.MaterialType" />
<wt:display field="Entity.MaterialName" /> <wt:display field="Entity.MaterialName" />
@@ -3,9 +3,6 @@
<wt:form vm="@Model"> <wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two"> <wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="Entity.UniqueCode" />
<wt:textbox field="Entity.QRCode" />
<wt:textbox field="Entity.SourceCode" />
<wt:textbox field="Entity.MaterialCode" /> <wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" /> <wt:textbox field="Entity.MaterialType" />
<wt:textbox field="Entity.MaterialName" /> <wt:textbox field="Entity.MaterialName" />
@@ -3,8 +3,6 @@
<wt:searchpanel vm="@Model" reset-btn="true"> <wt:searchpanel vm="@Model" reset-btn="true">
<wt:row items-per-row="ItemsPerRowEnum.Three"> <wt:row items-per-row="ItemsPerRowEnum.Three">
<wt:textbox field="Searcher.UniqueCode" />
<wt:textbox field="Searcher.QRCode" />
<wt:textbox field="Searcher.MaterialCode" /> <wt:textbox field="Searcher.MaterialCode" />
</wt:row> </wt:row>
</wt:searchpanel> </wt:searchpanel>
@@ -225,5 +225,75 @@ namespace HHWMS.Web.Controllers
} }
#endregion #endregion
[ActionDescription("Inventory.Out")]
public IActionResult Out(int id)
{
var inv = _unitwork.FindById<Inventory>(id);
if (inv == null)
{
return FFResult().RefreshGrid().Alert("选定库存不存在!请检查后再执行出库任务!");
}
if (_unitwork.IsExit<TaskHeader>(x => x.ContainerCode.Equals(inv.ContainerCode)))
{
return FFResult().RefreshGrid().Alert("选定库存已存在任务!请检查后再执行出库任务!");
}
var location = _unitwork.FindSingle<Location>(x => x.Code == inv.LocationCode);
if (location != null)
{
location.Status = LocationStatus.任务锁;
location.UpdateTime = DateTime.Now;
location.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
_unitwork.Update(location);
// 查找container,并更新状态
var container = _unitwork.FindSingle<Container>(x => x.Code == location.ContainerCode);
container.IsLock = ContainerLockEnum.任务锁;
container.UpdateTime = DateTime.Now;
container.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
_unitwork.Update(container);
//创建出库任务
var task = new TaskHeader
{
ZoneCode = ZoneCodeEnum.立库,
TaskNo = _unitwork.GetSerialNumber("Out"),
TaskType = TaskTypeEnum.立库出库,
ContainerCode = location.ContainerCode,
FromLocation = location.Code,
ToLocation = "",
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 res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, postData)
.Result.Data;
if (res.Success)
{
task.Status = TaskStatusEnum.已下发;
}
else
{
task.ErrorMsg = res.Msg;
}
task.UpdateTime = DateTime.Now;
task.UpdateBy = "WMS";
_unitwork.Update(task);
}
return FFResult().RefreshGrid().Message("任务创建成功!");
}
} }
} }
@@ -24,7 +24,7 @@ namespace HHWMS.Web
return new List<GridAction> return new List<GridAction>
{ {
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"inventory", dialogWidth: 800), this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"inventory", dialogWidth: 800),
this.MakeAction("Inventory","ReturnToMes",Localizer["Inventory.ReturnToMes"],Localizer["Inventory.ReturnToMes"],GridActionParameterTypesEnum.SingleId,"inventory"), this.MakeAction("Inventory","Out",Localizer["Inventory.Out"],Localizer["Inventory.Out"],GridActionParameterTypesEnum.SingleId,"inventory"),
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "inventory", dialogWidth: 800), this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "inventory", dialogWidth: 800),
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "inventory", dialogWidth: 800), this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "inventory", dialogWidth: 800),
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "inventory", dialogWidth: 800), this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "inventory", dialogWidth: 800),
@@ -55,15 +55,15 @@ namespace HHWMS.Web
var data = ZoneCodes.FirstOrDefault(x => x.Value.ToString() == a.ZoneCode); var data = ZoneCodes.FirstOrDefault(x => x.Value.ToString() == a.ZoneCode);
return data?.Text ?? a.ZoneCode; return data?.Text ?? a.ZoneCode;
}), }),
this.MakeGridHeader(x => x.ContainerCode).SetHide(), this.MakeGridHeader(x => x.ContainerCode),
this.MakeGridHeader(x => x.LocationCode), this.MakeGridHeader(x => x.LocationCode),
this.MakeGridHeader(x => x.MaterialCode), this.MakeGridHeader(x => x.MaterialCode),
this.MakeGridHeader(x => x.MaterialType), // this.MakeGridHeader(x => x.MaterialType),
this.MakeGridHeader(x => x.MaterialName), this.MakeGridHeader(x => x.MaterialName),
this.MakeGridHeader(x => x.MaterialSpec), // this.MakeGridHeader(x => x.MaterialSpec),
this.MakeGridHeader(x => x.MaterialUnit), // this.MakeGridHeader(x => x.MaterialUnit),
this.MakeGridHeader(x => x.Batch), // this.MakeGridHeader(x => x.Batch),
this.MakeGridHeader(x => x.Lot), // this.MakeGridHeader(x => x.Lot),
//this.MakeGridHeader(x => x.ManufactureDate), //this.MakeGridHeader(x => x.ManufactureDate),
//this.MakeGridHeader(x => x.ExpirationDate), //this.MakeGridHeader(x => x.ExpirationDate),
//this.MakeGridHeader(x => x.CompanyCode), //this.MakeGridHeader(x => x.CompanyCode),
@@ -1,3 +1,6 @@
using System;
using System.Linq;
using HHWMS.Web.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Mvc; using WalkingTec.Mvvm.Mvc;
@@ -5,14 +8,16 @@ using WalkingTec.Mvvm.Mvc;
namespace HHWMS.Web.Controllers namespace HHWMS.Web.Controllers
{ {
[Area("receipt")] [Area("receipt")]
[ActionDescription("盘料操作")] [ActionDescription("入库操作")]
public partial class ReceiptInController : BaseController public partial class ReceiptInController : BaseController
{ {
private readonly IUnitWork _unitWork; private readonly IUnitWork _unitWork;
private readonly WTMContext _context;
public ReceiptInController(IUnitWork unitwork) public ReceiptInController(IUnitWork unitWork, WTMContext wtmContext)
{ {
_unitWork = unitwork; _unitWork = unitWork;
_context = wtmContext;
} }
#region Index #region Index
@@ -24,5 +29,125 @@ namespace HHWMS.Web.Controllers
} }
#endregion Index #endregion Index
[HttpPost]
public ActionResult TaskIn(string containerCode, bool inv, bool agv)
{
if (Wtm == null)
{
Wtm = _context;
}
// 判断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为true,则返回错误信息
if (!string.IsNullOrEmpty(container.LocationCode) || container.IsLock == ContainerLockEnum.任务锁)
{
return JsonMore(null, 500, $"容器 {containerCode} 已被锁定或已在库内!");
}
container.IsLock = ContainerLockEnum.任务锁;
container.UpdateTime = DateTime.Now;
container.UpdateBy = Wtm?.LoginUserInfo?.ITCode??"WMS";
// _unitWork.Update(container);
//查找仓位
var location = _unitWork.Find<Location>(u => u.Status == LocationStatus.空仓位
&& u.Type == container.Type
&& !u.IsStop)
.OrderByDescending(x => x.Layer)
.ThenByDescending(x => x.Line)
.FirstOrDefault();
// 判断location是否为空
if (location == null)
{
return JsonMore(null, 500, "库内没有空闲仓位!");
}
location.Status = LocationStatus.任务锁;
location.UpdateTime = DateTime.Now;
location.UpdateBy = Wtm?.LoginUserInfo?.ITCode??"WMS";
_unitWork.Update(location);
if (inv) //有货
{
_unitWork.Add<Inventory>(new Inventory()
{
ZoneCode = ZoneCodeEnum.立库,
ContainerCode = containerCode,
LocationCode = location.Code,
MaterialCode = "123456",
MaterialName = "矿泉水",
Qty = 1,
TaskStatus = InventoryTaskStatus.任务中,
CreateTime = DateTime.Now
});
}
_unitWork.Update(container);
//创建容器编码为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
};
try
{
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, postData)
.Result.Data;
if (res.Success)
{
task.Status = TaskStatusEnum.已下发;
}
else
{
task.ErrorMsg = res.Msg;
}
}
catch (Exception ex)
{
task.ErrorMsg = ex.Message;
}
task.UpdateTime = DateTime.Now;
task.UpdateBy = "WMS";
_unitWork.Update(task);
if (agv)
{
// 调用AGV接口
var task_id = Wtm.ConfigInfo.AppSettings
.FirstOrDefault(x => x.Key == "OutIn").Value;
var res2 = Wtm.CallAPI<ShipOutController.agvResult>("ACS", "task_mould_do", HttpMethodEnum.POST, new
{
task_id = task_id
});
}
return JsonMore(null);
}
} }
} }
@@ -1,342 +1,86 @@
<el-row id="plapp" :gutter="20"> <div id="receiptin">
<el-col :span="6"> <a-space direction="vertical" fill>
<el-card class="box-card" :span="8"> <a-space>
<el-select v-model="value" clearable filterable placeholder="请选择单据" size="big" style="width:100%" <template #split>
@@change="changeselect" @@clear="clearReceipt"> <a-divider direction="vertical"/>
<el-option v-for="item in options" </template>
:key="item.value" <a-input :style="{width:'150px'}" placeholder="扫描箱号" v-model="ContainerCode" allow-clear/>
:label="item.label" <a-switch v-model="inv">
:value="item.value"> <template #checked>
</el-option> 载货
</el-select> </template>
<template #unchecked>
空箱
</template>
</a-switch>
<el-table :data="tableData" height="700" border <a-switch v-model="agv">
style="width: 100%"> <template #checked>
<el-table-column prop="name" 出库口
label="唯一码" </template>
align="center"> <template #unchecked>
</el-table-column> 入库口
</el-table> </template>
</el-card> </a-switch>
</el-col> </a-space>
<el-col :span="18">
<el-card class="box-card" :span="16">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="单据名称">
<el-input v-model="form.code" readonly></el-input>
</el-form-item>
<el-form-item label="周转箱编码" prop="boxCode">
<el-input v-model="form.boxCode" @@change="scanBox" ref="boxCode"></el-input>
</el-form-item>
<el-form-item label="料盘尺寸" prop="size">
<el-select v-model="form.size" placeholder="请选择料盘尺寸" style="width:100%" @@change="changeSize" clearable>
<el-option v-for="item in form.boxSize"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="唯一码" prop="uniqueCode">
<el-input v-model="form.uniqueCode" @@change="scanUniqueCode" ref="uniqueCode"></el-input>
</el-form-item>
<el-table :data="bindingData"
ref="tableData"
height="450" border
style="width: 100%">
<el-table-column fixed="left"
label="操作"
width="120"
align="center">
<template slot-scope="scope">
<el-button @@click.native.prevent="deleteRow(scope.$index, bindingData)"
type="text"
size="small">
移除
</el-button>
</template>
</el-table-column>
<el-table-column label="入库单编码" align="center" prop="receiptCode" v-if="false"></el-table-column>
<el-table-column label="周转箱" align="center" prop="boxCode"></el-table-column>
<el-table-column label="索引" align="center" prop="index"></el-table-column>
<el-table-column label="唯一码" align="center" prop="uniqueCode"></el-table-column>
<el-table-column label="料盘尺寸" align="center" prop="size" :formatter="sizeFormatter"></el-table-column>
</el-table>
<el-form-item style="float:right">
<el-button type="primary" @@click="onSubmit">绑定入库</el-button>
<el-button @@click="resetForm('form')">重置</el-button>
@* <el-button type="primary" @@click="inOperation">启动入库</el-button> *@
</el-form-item>
</el-form>
</el-card>
</el-col>
</el-row>
<a-space>
<a-button @@click="handleClick"
:loading="loading1"
type="primary" size="large">
入库
</a-button>
</a-space>
</a-space>
</div>
<script> <script>
var app = new Vue({ const { createApp, reactive, ref } = Vue
el: '#plapp',
data() {
var validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入工位编码'));
}
else if (value == 'L01' || value == 'L02') {
callback();
} else {
callback(new Error('请输入正确工位编码'));
}
};
return { const app = createApp({
form: { data() {
code: '', return {
boxCode: '', ContainerCode: '',
boxSize: [], loading1:false,
size: '', inv:false,
uniqueCode: '' agv:false,
}, data: reactive([])
options: [], }
value: '', },
tableData: [], methods: {
bindingData: [],
dataIndex: [],
rules: {
boxCode: [
{ validator: validatePass, trigger: 'blur' }
]
}
}
},
mounted: function () {
// 获取所有单据编码
$.ajax({
type: "post",
dataType: "json",
data: {},
url: "/receipt/ReceiptIn/SelectReceiptCode",
success: function (json) {
app.options = json.Data;
},
error: function (json) {
alert("加载失败");
}
});
},
methods: {
sizeFormatter(row) {
return row.size + 'mm';
},
//绑定单据
onSubmit() {
var _this = this;
// 提交已绑定数据 handleClick() {
$.ajax({ var _this = this;
type: "post", if (_this.ContainerCode == ""){
dataType: "json", _this.$message.error("请扫描箱号!");
data: { data: _this.bindingData }, return;
url: "/receipt/ReceiptIn/BindingData",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: '入库成功!',
type: 'success'
});
_this.resetForm('form');
}
else {
_this.$message({
message: '入库失败!',
type: 'warning'
});
}
},
error: function (json) {
_this.$message({
message: '入库失败!',
type: 'error'
});
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.form.boxSize = [];
this.bindingData = [];
},
clearReceipt() {
this.tableData = [];
},
// 选择单据后,查询明细
changeselect(data) {
var _this = this;
_this.form.code = data;
// 调用后台方法,查询单据明细数据
if (data != "") {
$.ajax({
type: "post",
dataType: "json",
data: { Code: data },
url: "/receipt/ReceiptIn/SelectReceipt",
success: function (json) {
_this.tableData = json.Data;
// 对比待绑定列表,删除在其表内的明细
_this.bindingData.forEach(function (item) {
_this.tableData.forEach(function (value, index, arr) {
if (value.name == item.uniqueCode) {
arr.splice(index, 1);
}
});
})
},
error: function (json) {
_this.$message({
message: '加载单据明细失败!',
type: 'error'
});
}
});
}
},
// 扫描周转箱
scanBox(Box) {
var _this = this;
_this.form.size = '';
_this.form.boxSize = [];
if (this.form.code == '') {
this.$message({
message: '请先选择单据!',
type: 'warning'
});
return;
}
$.ajax({
type: "post",
dataType: "json",
data: { boxCode: Box },
url: "/receipt/ReceiptIn/ScanBox",
success: function (json) {
if (json.Code != 200) {
_this.$message({
message: "扫描失败!" + json.Msg,
type: "warning",
duration: "10000",
});
_this.form.boxCode = "";
return false;
}
else {
_this.$message({
message: "扫描成功!",
type: "success",
duration: "10000",
});
_this.$refs.uniqueCode.focus();
if (Box == "L02") {
_this.form.boxSize = [{ label: "24mm", value: "24" }, { label: "16mm", value: "16" }, { label: "10mm", value: "10" }]
_this.dataIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
}
else if (Box == "L01") {
_this.form.boxSize = [{ label: "8mm", value: "8" }];
_this.form.size = _this.form.boxSize[0].value;
_this.dataIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
}
else {
_this.$message({
message: '输入周转箱编码不正确!',
type: 'warning'
});
return;
}
}
},
error: function (json) {
_this.$message({
message: "扫描失败!",
type: "error",
duration: "10000",
});
return;
},
});
// 重新扫描箱号后,待绑定列表清空
_this.bindingData = [];
_this.changeselect(_this.value);
// _this.$refs.uniqueCode.focus();
},
// 选择尺寸后
changeSize() {
this.$refs.uniqueCode.focus();
},
// 扫描唯一码
scanUniqueCode(data) {
if (this.form.code == '') {
this.$message({
message: '请先选择单据!',
type: 'warning'
});
return;
}
if (this.dataIndex.length == 0) {
this.$message({
message: '该周转箱已放满!',
type: 'warning'
});
this.form.uniqueCode = '';
return;
}
if (this.form.boxCode == '' || this.form.size == '') {
this.$message({
message: '请先输入周转箱编码并选择料盘尺寸!',
type: 'warning'
});
this.form.uniqueCode = '';
return;
}
var isExit = this.tableData.findIndex(function (value, index, arr) {
return value.name == data;
})
if (isExit == -1) {
this.$message({
message: '唯一码' + data + '不正确!',
type: 'warning'
});
this.form.uniqueCode = '';
return;
}
// 1.明细减少
this.tableData.forEach(function (item, index, arr) {
if (item.name == data) {
arr.splice(index, 1);
}
});
// 2.已扫描增加
this.bindingData.push({
receiptCode: this.form.code,
boxCode: this.form.boxCode,
index: this.dataIndex.shift(),
uniqueCode: data,
size: this.form.size
})
this.form.uniqueCode = '';
this.$nextTick(() => {
this.$refs.tableData.bodyWrapper.scrollTop = this.$refs.tableData.bodyWrapper.scrollHeight
})
},
// 删除已绑定行
deleteRow(index, rows) {
if (this.form.code == rows[index].receiptCode) {
this.tableData.push({ name: rows[index].uniqueCode });
}
this.dataIndex.unshift(rows[index].index);
rows.splice(index, 1);
}
} }
});
_this.loading1 = !_this.loading1
let postData = new URLSearchParams();
postData.append('containerCode', _this.ContainerCode);
postData.append('inv', _this.inv);
postData.append('agv', _this.agv);
axios.post("/receipt/ReceiptIn/TaskIn", postData)
.then(function (json) {
_this.loading1 = !_this.loading1;
if (json.data.Code == 200){
_this.ContainerCode = '';
_this.$message.success("入库任务创建成功!");
}
else{
_this.$message.error(json.data.Msg);
}
})
.catch(function (error) {
_this.$message.error(error);
});
}
}
});
app.use(ArcoVue)
.use(ArcoVueIcon)
.mount('#receiptin');
</script> </script>
@@ -1,3 +1,6 @@
using System;
using System.Linq;
using HHWMS.Web.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Mvc; using WalkingTec.Mvvm.Mvc;
@@ -24,4 +27,116 @@ public class ShipOutController : BaseController
} }
#endregion #endregion
[HttpPost]
public IActionResult CallBox()
{
// 查找库位状态为空容器的库位
var location = _unitWork.FindSingle<Location>(x => x.Status == LocationStatus.空容器);
if (location != null)
{
location.Status = LocationStatus.任务锁;
location.UpdateTime = DateTime.Now;
location.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
_unitWork.Update(location);
// 查找container,并更新状态
var container = _unitWork.FindSingle<Container>(x => x.Code == location.ContainerCode);
container.IsLock = ContainerLockEnum.任务锁;
container.UpdateTime = DateTime.Now;
container.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
_unitWork.Update(container);
//创建出库任务
var task = new TaskHeader
{
ZoneCode = ZoneCodeEnum.立库,
TaskNo = _unitWork.GetSerialNumber("Out"),
TaskType = TaskTypeEnum.立库出库,
ContainerCode = location.ContainerCode,
FromLocation = location.Code,
ToLocation = "",
Station = "1",
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
};
try
{
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, postData)
.Result.Data;
if (res.Success)
{
task.Status = TaskStatusEnum.已下发;
}
else
{
task.ErrorMsg = res.Msg;
}
}
catch (Exception ex)
{
task.ErrorMsg = ex.Message;
}
task.UpdateTime = DateTime.Now;
task.UpdateBy = "WMS";
_unitWork.Update(task);
return JsonMore(null);
}
else
{
return JsonMore(null, 500, "库内无可用空容器!");
}
}
public IActionResult AgvTask(string type)
{
try
{
var ids = Wtm.ConfigInfo.AppSettings.ToList();
var task_id = type switch
{
"In" => ids.FirstOrDefault(x => x.Key == "In").Value,
"Out" => ids.FirstOrDefault(x => x.Key == "Out").Value,
"Charge" => ids.FirstOrDefault(x => x.Key == "Charge").Value,
"OutIn" => ids.FirstOrDefault(x => x.Key == "OutIn").Value,
_ => throw new Exception("参数错误!")
};
var res = Wtm.CallAPI<agvResult>("ACS", "task_mould_do", HttpMethodEnum.POST, new
{
task_id = task_id
});
if (res.Result.Data.ack != 0)
{
return JsonMore(null, 500, res.Result.Data.msg);
}
return JsonMore(null);
}
catch (Exception ex)
{
return JsonMore(null, 500, ex.Message);
}
}
public class agvResult
{
public int ack { get; set; }
public string msg { get; set; }
public dynamic data { get; set; }
}
} }
@@ -1,299 +1,101 @@
<el-row id="outapp"> <div id="shipout">
<el-card class="box-card" :span="16"> <a-space direction="vertical" fill :size="large">
<el-form ref="form" :model="form" label-width="100px"> @* <a-input :style="{width:'320px'}" placeholder="扫描箱号" v-model="ContainerCode" allow-clear/> *@
<el-row> <a-button @@click="handleClick"
<el-col :span="4"> :loading="loading1"
<el-form-item label="类型" prop="type"> type="primary"
<el-select v-model="form.type" size="large">
placeholder="请选择类型" 呼叫出库
style="width: 100%" </a-button>
@@change="select"
>
<el-option v-for="item in taskType"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="16">
<el-input v-model="form.code"
placeholder="请扫描"
@@change="scanCode">
</el-input>
</el-col>
</el-row>
<el-row v-show="showTable">
<el-divider></el-divider>
<el-table :data="invTable" height="200" stripe border @@row-click="selectdata"
style="width: 100%">
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
<el-table-column label="编码" align="center" prop="MaterialCode"></el-table-column>
<el-table-column label="规格型号" align="center" prop="MaterialSpec"></el-table-column>
<el-table-column label="批次" align="center" prop="Batch"></el-table-column>
<el-table-column label="数量" align="center" prop="Qty"></el-table-column>
</el-table>
</el-row>
<el-divider></el-divider>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="唯一码" prop="uniqueCode">
<el-input v-model="form.uniqueCode" ref="uniqueCode" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料码" prop="materialCode">
<el-input v-model="form.materialCode" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格型号" prop="materialSpec">
<el-input v-model="form.materialSpec" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="批次" prop="batch">
<el-input v-model="form.batch" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="qty">
<el-input v-model.number="form.qty" ref="qty" ></el-input>
</el-form-item>
</el-col>
<el-form-item style="float:right"> <a-divider />
<el-button type="primary" @@click="onSubmit">拣货</el-button> <a-space>
<el-button v-show="showBack" type="success" @@click="back">回库</el-button> <template #split>
</el-form-item> <a-divider direction="vertical" />
</el-row> </template>
</el-form> <a-button @@click='handleAGVTask("OutIn")'
</el-card> :loading="loading2"
</el-row> type="primary"
status="warning"
size="large">
入库
</a-button>
<a-button @@click='handleAGVTask("Charge")'
:loading="loading2"
type="primary"
status="success"
size="large">
充电任务
</a-button>
@* <a-button @@click='handleAGVTask("Out")' *@
@* :loading="loading2" *@
@* type="outline" *@
@* size="large"> *@
@* 到出库点 *@
@* </a-button> *@
</a-space>
</a-space>
</div>
<script> <script>
var app = new Vue({ const { createApp, reactive, ref } = Vue
el: "#outapp",
data() { const app = createApp({
return { data() {
form: { return {
type:"", ContainerCode: '',
code: "", loading1:false,
uniqueCode: "", loading2:false,
materialCode: "", data: reactive([])
materialSpec: "", }
batch: "", },
qty: "" methods: {
}, handleClick() {
type: "", var _this = this;
taskType: [
{ label: "散料站台", value: "slbox" }, _this.loading1 = !_this.loading1
{ label: "料塔周转箱", value: "lt" },
{ label: "唯一码", value: "uniqueCode" }, axios.post("/shipment/Shipout/CallBox", {})
], .then(function (json) {
invTable:[], _this.loading1 = !_this.loading1;
showTable: false, if (json.data.Code == 200){
showBack: false _this.$message.success("呼叫料盒任务创建成功!");
};
},
methods: {
// 选中行
selectdata(data) {
this.form.uniqueCode = data.UniqueCode;
this.form.materialCode = data.MaterialCode;
this.form.materialSpec = data.MaterialSpec;
this.form.batch = data.Batch;
this.form.qty = data.Qty;
},
select(data) {
this.form.code = "";
this.form.type = data;
this.invTable = [];
if (this.invTable.length == 0
&& this.form.type == "slbox"
&& this.form.code.startsWith("C")) {
this.showBack = true;
}
},
// 扫描料塔站台号
scanCode(data) {
var _this = this;
if (_this.form.type == "") {
_this.$message({
message: "请先选择操作类型!",
type: "warning",
duration: "10000",
});
_this.form.code = "";
return;
}
let url = "";
if (_this.form.type == "uniqueCode") {
url = "/shipment/ShipOut/ScanUniqueCode"
}
else{
url = "/shipment/ShipOut/ScanBox"
}
$.ajax({
type: "post",
dataType: "json",
data: { code: _this.form.code, type: _this.form.type },
url: url,
success: function (json) {
if (json.Code != 200) {
_this.$message({
message: "扫描失败!" + json.Msg,
type: "warning",
duration: "10000",
});
_this.form.code = "";
} else {
if (_this.form.type == "uniqueCode") {
_this.form.uniqueCode = json.Data.UniqueCode;
_this.form.materialCode = json.Data.MaterialCode;
_this.form.materialSpec = json.Data.MaterialSpec;
_this.form.batch = json.Data.Batch;
_this.form.qty = json.Data.Qty;
} else {
_this.showTable = true;
_this.invTable = json.Data;
if (_this.invTable.length == 0
&& _this.form.type == "slbox"
&& _this.form.code.startsWith("C")) {
_this.showBack = true;
}
}
}
},
error: function (json) {
_this.$message({
message: "扫描失败!",
type: "error",
duration: "10000",
});
},
});
},
// 拣货
onSubmit() {
var _this = this;
if (_this.form.uniqueCode == "") {
_this.$message({
message: "未选择出库明细!",
type: "warning",
duration: "10000",
});
return;
}
// 提交已绑定数据
$.ajax({
type: "post",
dataType: "json",
data: { uniqueCode: _this.form.uniqueCode, qty: _this.form.qty, station: _this.form.code },
url: "/shipment/ShipOut/Pick",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: "拣货成功!",
});
// 删除invTable 对应的 uniqueCode行
_this.invTable.forEach(function (value, index, arr) {
if (value.UniqueCode == _this.form.uniqueCode) {
arr.splice(index, 1);
}
});
if (_this.invTable.length == 0
&& _this.form.type == "slbox"
&& _this.form.code.startsWith("C")) {
_this.showBack = true;
}
if (_this.form.code == "uniqueCode") {
_this.form.code = "";
}
// 清空下面表单 不清空code
_this.form.uniqueCode = "";
_this.form.materialCode = "";
_this.form.materialSpec = "";
_this.form.batch = "";
_this.form.qty = "";
// _this.$refs['form'].resetFields();
} else {
_this.$message({
message: "提交失败!"+json.Msg,
type: "warning",
duration: "10000",
});
}
},
error: function (json) {
_this.$message({
message: "提交失败!",
type: "error",
duration: "10000",
});
},
});
},
// 回库
back() {
var _this = this;
// 创建回库任务
if (_this.form.code == "") {
_this.$message({
message: "箱号为空,不能创建回库任务!",
type: "error",
duration: "1000",
});
return;
}
if (_this.invTable.length > 0) {
_this.$message({
message: "存在未拣货库存,不能创建回库任务!",
type: "error",
duration: "1000",
});
return;
}
this.$confirm('确定执行回库动作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.ajax({
type: "post",
dataType: "json",
data: { boxCode: _this.form.code, isFull: _this.form.isFull },
url: "/shipment/ShipOut/BoxBack",
success: function (json) {
if (json.Code != 200) {
_this.$message({
message: "回库任务创建失败!" + json.Msg,
type: "warning",
duration: "10000",
});
} else {
_this.$message({
message: "回库任务创建成功!"
});
_this.resetForm('form');
}
},
error: function (json) {
_this.$message({
message: "回库任务创建失败!",
type: "error",
duration: "10000",
});
},
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
} }
}, else{
}); _this.$message.error(json.data.Msg);
}
})
.catch(function (error) {
_this.$message.error(error);
});
},
handleAGVTask(val) {
var _this = this;
_this.loading2 = !_this.loading2
let postData = new URLSearchParams();
postData.append('type', val);
axios.post("/shipment/Shipout/AgvTask", postData)
.then(function (json) {
_this.loading2 = !_this.loading2;
if (json.data.Code == 200){
_this.$message.success("任务创建成功!");
}
else{
_this.$message.error(json.data.Msg);
}
})
.catch(function (error) {
_this.$message.error(error);
});
}
}
});
app.use(ArcoVue)
.use(ArcoVueIcon)
.mount('#shipout');
</script> </script>
@@ -144,7 +144,7 @@ namespace HHWMS.Web.Controllers
} }
else else
{ {
return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID); return FFResult().CloseDialog().RefreshGrid(index:1);
} }
} }
} }
@@ -172,7 +172,7 @@ namespace HHWMS.Web.Controllers
} }
else else
{ {
return FFResult().CloseDialog().RefreshGrid(); return FFResult().CloseDialog().RefreshGrid(index:1);
} }
} }
@@ -0,0 +1,76 @@
using System;
using System.Threading.Tasks;
using HHWMS.Web.Models;
using Quartz;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Support.Quartz;
namespace HHWMS.Web
{
//[QuartzRepeat(10,10, true, 30)]
[PersistJobDataAfterExecution]
[DisallowConcurrentExecution]
public class SendWcsJob : WtmJob
{
public override Task Execute(IJobExecutionContext context)
{
try
{
var _unitWork = new UnitWork(Wtm);
var task = _unitWork.FindSingle<TaskHeader>(x => x.Status == TaskStatusEnum.待下发);
if (task != null)
{
// 下发任务到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);
}
Wtm.DoLog("下发WCS任务", ActionLogTypesEnum.Job, "SendWcsJob");
#region 更新时间
var job = _unitWork.FindSingle<SysJob>(x =>
x.JobName == context.JobDetail.Key.Name
);
if (job != null)
{
job.LastFireTime = TimeZoneInfo.ConvertTimeFromUtc(
context.FireTimeUtc.DateTime,
TimeZoneInfo.Local
);
// 只执行一次 没有下次执行时间
if (context.NextFireTimeUtc != null)
{
job.NextFireTime = TimeZoneInfo.ConvertTimeFromUtc(
context.NextFireTimeUtc.Value.DateTime,
TimeZoneInfo.Local
);
}
_unitWork.Update<SysJob>(job);
}
#endregion
}
catch(Exception ex) {
Wtm.DoLog("下发WCS任务", ActionLogTypesEnum.Job, "SendWcsJob", request:"error", result:ex.Message);
}
return Task.CompletedTask;
}
}
}
@@ -57,15 +57,15 @@ namespace HHWMS.Web
{ {
string rv = UIService.MakeScriptButton(ButtonTypesEnum.Link,a.TaskNo,$"details('{a.ID}')"); string rv = UIService.MakeScriptButton(ButtonTypesEnum.Link,a.TaskNo,$"details('{a.ID}')");
return rv; return rv;
}).SetWidth(220), }).SetWidth(180),
this.MakeGridHeader(x => x.TaskType,150), this.MakeGridHeader(x => x.TaskType,150),
this.MakeGridHeader(x => x.ContainerCode, 150),
this.MakeGridHeader(x => x.FromLocation,150), this.MakeGridHeader(x => x.FromLocation,150),
this.MakeGridHeader(x => x.ToLocation, 150), this.MakeGridHeader(x => x.ToLocation, 150),
this.MakeGridHeader(x => x.Station,150), this.MakeGridHeader(x => x.Status, 150),
this.MakeGridHeader(x => x.ContainerCode, 150), this.MakeGridHeader(x => x.Station,150).SetHide(),
this.MakeGridHeader(x => x.RoadWay, 150).SetHide(), this.MakeGridHeader(x => x.RoadWay, 150).SetHide(),
this.MakeGridHeader(x => x.Priority, 150).SetHide(), this.MakeGridHeader(x => x.Priority, 150).SetHide(),
this.MakeGridHeader(x => x.Status, 150),
this.MakeGridHeader(x => x.CreateTime, 150).SetHide(), this.MakeGridHeader(x => x.CreateTime, 150).SetHide(),
this.MakeGridHeader(x => x.ErrorMsg, 150).SetHide(), this.MakeGridHeader(x => x.ErrorMsg, 150).SetHide(),
this.MakeGridHeaderAction(width: 200) this.MakeGridHeaderAction(width: 200)
@@ -14,7 +14,7 @@
</wt:row> </wt:row>
</wt:searchpanel> </wt:searchpanel>
<wt:grid vm="@Model" id="TaskHeader" url="/taskManage/TaskHeader/Search" limit="7" /> <wt:grid vm="@Model" id="TaskHeader" url="/taskManage/TaskHeader/Search" limit="7" />
<wt:grid vm="@Model.TaskDetails" id="TaskDetail" url="/taskManage/TaskDetail/Search2" height="400" /> @* <wt:grid vm="@Model.TaskDetails" id="TaskDetail" url="/taskManage/TaskDetail/Search2" height="400" /> *@
<script> <script>
var headerId = 0; var headerId = 0;
-12
View File
@@ -13,18 +13,6 @@ namespace HHWMS.Web.Models
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public new int ID { get; set; } public new int ID { get; set; }
[Display(Name = "Inventory.UniqueCode", Description = "唯一码")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string UniqueCode { get; set; }
[Display(Name = "Inventory.QRCode", Description = "二维码")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string QRCode { get; set; }
[Display(Name = "Inventory.SourceCode", Description = "上游单号")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string SourceCode { get; set; }
[Display(Name = "Inventory.MaterialCode", Description = "物料编码")] [Display(Name = "Inventory.MaterialCode", Description = "物料编码")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string MaterialCode { get; set; } public string MaterialCode { get; set; }
+13 -49
View File
@@ -29,13 +29,13 @@ namespace HHWMS.Web.Models
/// 入库任务 /// 入库任务
/// </summary> /// </summary>
[Display(Name = "TaskType.In")] [Display(Name = "TaskType.In")]
盘料盒入库 = 1, 立库入库 = 1,
/// <summary> /// <summary>
/// 出库任务 /// 出库任务
/// </summary> /// </summary>
[Display(Name = "TaskType.Out")] [Display(Name = "TaskType.Out")]
盘料盒出库 = 2, 立库出库 = 2,
/// <summary> /// <summary>
/// 盘料入库 /// 盘料入库
@@ -104,16 +104,10 @@ namespace HHWMS.Web.Models
/// <summary> /// <summary>
/// 容器类型 /// 容器类型
/// </summary> /// </summary>
public enum ContainerTypeEnum : int public static class ContainerTypeEnum
{ {
//// 11:23格料盒; 12:13格料盒; 13:16格料盒; 14:19格料盒 public const string 料箱 = "B";
格料盒23 = 11, public const string 托盘 = "P";
格料盒13 = 12,
格料盒16 = 13,
格料盒19 = 14,
} }
/// <summary> /// <summary>
@@ -258,7 +252,7 @@ namespace HHWMS.Web.Models
} }
/// <summary> /// <summary>
/// 交易类型 /// 库存任务状态
/// </summary> /// </summary>
public static class InventoryTaskStatus public static class InventoryTaskStatus
{ {
@@ -280,55 +274,25 @@ namespace HHWMS.Web.Models
public static class ZoneCodeEnum public static class ZoneCodeEnum
{ {
/// <summary> /// <summary>
/// 盘料库 = "L"; /// 立库 = "L";
/// </summary> /// </summary>
public const string 盘料库 = "L"; public const string 立库 = "L";
/// <summary>
/// 散料库 = "C";
/// </summary>
public const string 散料库 = "C";
/// <summary>
/// 货架库 = "P";
/// </summary>
public const string 货架库 = "P";
} }
/// <summary> /// <summary>
/// 区域 /// 类型
/// </summary> /// </summary>
public static class LocationTypeEnum public static class LocationTypeEnum
{ {
/// <summary> /// <summary>
/// 盘料库位 = "L"; /// 周转箱库位 = "B";
/// </summary> /// </summary>
public const string 盘料库位 = "L"; public const string 周转箱库位 = "B";
/// <summary> /// <summary>
/// 料塔 = "T"; /// 托盘库位 = "P";
/// </summary> /// </summary>
public const string 料塔 = "T"; public const string 托盘库位 = "P";
/// <summary>
/// 机械臂工位 = "G2";
/// </summary>
public const string 机械臂工位 = "G2";
/// <summary>
/// 堆垛机工位 = "G1";
/// </summary>
public const string 堆垛机工位 = "G1";
/// <summary>
/// 散料库 = "C";
/// </summary>
public const string 散料库位 = "C";
/// <summary>
/// 散料库站台 = "C1";
/// </summary>
public const string 散料库站台 = "C1";
} }
+3 -3
View File
@@ -18,12 +18,12 @@
}, },
"HHWMS.Web": { "HHWMS.Web": {
"commandName": "Project", "commandName": "Project",
"launchBrowser": true, "launchBrowser": false,
"applicationUrl": "http://127.0.0.1:5000",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
}, }
"applicationUrl": "http://localhost:5000/"
} }
} }
} }
+31 -28
View File
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
@@ -924,4 +924,7 @@
<data name="_Admin.ZipCode" xml:space="preserve"> <data name="_Admin.ZipCode" xml:space="preserve">
<value>Zip</value> <value>Zip</value>
</data> </data>
</root> <data name="Inventory.Out" xml:space="preserve">
<value />
</data>
</root>
+39 -30
View File
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
@@ -1018,10 +1018,10 @@
<value>错误信息</value> <value>错误信息</value>
</data> </data>
<data name="TaskType.In" xml:space="preserve"> <data name="TaskType.In" xml:space="preserve">
<value>盘料盒入库</value> <value>立库入库</value>
</data> </data>
<data name="TaskType.Out" xml:space="preserve"> <data name="TaskType.Out" xml:space="preserve">
<value>盘料盒出库</value> <value>立库出库</value>
</data> </data>
<data name="TaskType.PIn" xml:space="preserve"> <data name="TaskType.PIn" xml:space="preserve">
<value>盘料入库</value> <value>盘料入库</value>
@@ -1152,6 +1152,12 @@
<data name="Location.AddLocation" xml:space="preserve"> <data name="Location.AddLocation" xml:space="preserve">
<value>添加库位</value> <value>添加库位</value>
</data> </data>
<data name="Location.StopLocation" xml:space="preserve">
<value>禁用库位</value>
</data>
<data name="Location.LiftLocation" xml:space="preserve">
<value>解禁库位</value>
</data>
<data name="Location.BeginLine" xml:space="preserve"> <data name="Location.BeginLine" xml:space="preserve">
<value>起始列</value> <value>起始列</value>
</data> </data>
@@ -1225,7 +1231,7 @@
<value>批次</value> <value>批次</value>
</data> </data>
<data name="Inventory.Lot" xml:space="preserve"> <data name="Inventory.Lot" xml:space="preserve">
<value>格</value> <value>Lot</value>
</data> </data>
<data name="Inventory.ManufactureDate" xml:space="preserve"> <data name="Inventory.ManufactureDate" xml:space="preserve">
<value>生产日期</value> <value>生产日期</value>
@@ -1407,4 +1413,7 @@
<data name="MenuKey.InterfaceLog" xml:space="preserve"> <data name="MenuKey.InterfaceLog" xml:space="preserve">
<value>接口日志</value> <value>接口日志</value>
</data> </data>
<data name="Inventory.Out" xml:space="preserve">
<value>出库</value>
</data>
</root> </root>
+2 -1
View File
@@ -46,9 +46,10 @@
<script src="/hiprint/polyfill.min.js"></script> <script src="/hiprint/polyfill.min.js"></script>
<script src="/hiprint/hiprint.bundle.js"></script> <script src="/hiprint/hiprint.bundle.js"></script>
<script src="/hiprint/plugins/qrcode.js"></script> <script src="/hiprint/plugins/qrcode.js"></script>
<script src="/hiprint/plugins/JsBarcode.all.min.js"></script>
<script src="/hiprint/plugins/jquery.minicolors.min.js"></script> <script src="/hiprint/plugins/jquery.minicolors.min.js"></script>
<script src="/hiprint/plugins/jquery.hiwprint.js"></script> <script src="/hiprint/plugins/jquery.hiwprint.js"></script>
<script src="/hiprint/plugins/jquery.jqprint-0.3.js"></script> <script src="/hiprint/plugins/jquery.jqprint-0.3.js"></script>
<script> <script>
var DONOTUSE_IGNOREHASH = false; var DONOTUSE_IGNOREHASH = false;
var DONOTUSE_COOKIEPRE = '@ViewData["DONOTUSE_COOKIEPRE"]'; var DONOTUSE_COOKIEPRE = '@ViewData["DONOTUSE_COOKIEPRE"]';
+1 -20
View File
@@ -31,25 +31,6 @@ namespace WebService
var data = JsonConvert.DeserializeObject<MesMaterials>(materails); var data = JsonConvert.DeserializeObject<MesMaterials>(materails);
// 插入物料信息表 // 插入物料信息表
var materialList = new List<Material>(); var materialList = new List<Material>();
foreach (var item in data.ISSUEMATERIALS.ISSUEITEM)
{
var material = new Material
{
MaterialCode = item.MATNR,
MaterialName = item.MAKTX,
MaterialType = item.BWART,
MaterialUnit = item.ERFME,
MaterialSpec = item.ZZXHGG,
Batch = item.LICHA,
QRCode = item.ZMBLNR,
Qty = decimal.Parse(item.MENGE),
SourceCode = item.AUFNR,
SupplierCode = item.ZZSCCJ,
CreateTime = DateTime.Now,
CreateBy = "mes"
};
materialList.Add(material);
}
_unitwork.BatchAdd<Material>(materialList.ToArray()); _unitwork.BatchAdd<Material>(materialList.ToArray());
return new Result(); return new Result();
} }
@@ -65,7 +46,7 @@ namespace WebService
try try
{ {
_wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: outOrder); _wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: outOrder);
return new Result(); return new Result();
} }
catch (Exception ex) catch (Exception ex)
+18 -11
View File
@@ -22,17 +22,17 @@
}, },
"Connections": [ "Connections": [
//{
// "Key": "default",
// "Value": "Server=127.0.0.1;Port=3306;Database=WMS;Uid=root;Password=abc123*;Character Set=utf8mb4;",
// "DBType": "mysql"
//},
{ {
"Key": "default", "Key": "default",
"Value": "Data Source=.;Initial Catalog=WMS;User=sa;Password=abc123*;Persist Security Info=True", "Value": "Server=127.0.0.1;Port=3306;Database=lkwms;Uid=root;Password=abc123*;Character Set=utf8mb4;",
"DbContext": "DataContext", "DBType": "mysql"
"DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle },
} //{
// "Key": "default",
// "Value": "Data Source=.;Initial Catalog=WMS;User=sa;Password=abc123*;Persist Security Info=True",
// "DbContext": "DataContext",
// "DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
//}
//{ //{
// "Key": "default", // "Key": "default",
// "Value": "Data Source=10.18.106.4;Initial Catalog=8357wms;User=wms;Password=abc123*;Persist Security Info=True", // "Value": "Data Source=10.18.106.4;Initial Catalog=8357wms;User=wms;Password=abc123*;Persist Security Info=True",
@@ -111,11 +111,18 @@
"Address": "https://api.github.com" "Address": "https://api.github.com"
}, },
"WCS": { "WCS": {
"Address": "http://10.18.97.205:1111/api/WcsWebApi/" "Address": "http://192.168.30.200:65533/api/WCS/"
},
"ACS": {
"Address": "http://192.168.30.136:10002/"
} }
}, },
"AppSettings": { "AppSettings": {
"Key1": "abc", "Key1": "abc",
"Key2": "123" "Key2": "123",
"Out": "123",
"In": "123",
"Charge": "123",
"OutIn": "123",
} }
} }