测试
This commit is contained in:
parent
3467d4aa9d
commit
820d9d065b
@ -86,7 +86,7 @@ namespace HHWMS.Web
|
||||
Batch = detail.Batch,
|
||||
Lot = detail.Lot,
|
||||
ContainerCode = task.ContainerCode,
|
||||
LocaionCode = task.ToLocation,
|
||||
LocationCode = task.ToLocation,
|
||||
Qty = detail.Qty,
|
||||
TaskStatus = InventoryTaskStatus.无任务
|
||||
};
|
||||
@ -102,7 +102,7 @@ namespace HHWMS.Web
|
||||
Batch = detail.Batch,
|
||||
Lot = detail.Lot,
|
||||
ContainerCode = task.ContainerCode,
|
||||
LocaionCode = task.ToLocation,
|
||||
LocationCode = task.ToLocation,
|
||||
Qty = detail.Qty,
|
||||
};
|
||||
_unitwork.Add(invTran);
|
||||
|
||||
@ -62,13 +62,13 @@ namespace HHWMS.Web
|
||||
this.MakeGridHeader(x => x.Row),
|
||||
this.MakeGridHeader(x => x.Line),
|
||||
this.MakeGridHeader(x => x.Layer),
|
||||
this.MakeGridHeader(x => x.RoadWay),
|
||||
this.MakeGridHeader(x => x.RoadWay).SetHide(),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.IsStop),
|
||||
this.MakeGridHeader(x => x.Length),
|
||||
this.MakeGridHeader(x => x.Width),
|
||||
this.MakeGridHeader(x => x.Height),
|
||||
this.MakeGridHeader(x => x.ContiguousCode),
|
||||
this.MakeGridHeader(x => x.Length).SetHide(),
|
||||
this.MakeGridHeader(x => x.Width).SetHide(),
|
||||
this.MakeGridHeader(x => x.Height).SetHide(),
|
||||
this.MakeGridHeader(x => x.ContiguousCode).SetHide(),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
|
||||
@ -9,6 +9,8 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class LocationVM : BaseCRUDVM<Location>
|
||||
{
|
||||
public InventoryListVM Inventorys { get; set; } = new InventoryListVM();
|
||||
|
||||
[Display(Name = "Location.BeginLine", Description = "起始列")]
|
||||
[Required(ErrorMessage = "Validate.{0}required")]
|
||||
public short BeginLine { get; set; }
|
||||
@ -34,6 +36,9 @@ namespace HHWMS.Web
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
Inventorys.CopyContext(this);
|
||||
Inventorys.Searcher.LocationCode = Entity.Code;
|
||||
|
||||
_unitWork = new UnitWork(Wtm);
|
||||
var CurrentCulture = Wtm.CurrentCulture;
|
||||
var dictDatas = DC.Set<SysDictData>().ToList();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
@model HHWMS.Web.LocationVM
|
||||
@model HHWMS.Web.LocationVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:form vm="@Model">
|
||||
@ -18,6 +18,9 @@
|
||||
<wt:display field="Entity.Height" />
|
||||
<wt:display field="Entity.ContiguousCode" />
|
||||
</wt:row>
|
||||
|
||||
<wt:grid vm="@Model.Inventorys" height="300" hidden-checkbox="true" hidden-grid-index="true" use-local-data="true" hidden-panel="true"/>
|
||||
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:closebutton />
|
||||
</wt:row>
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
|
||||
<wt:textbox field="Searcher.Code" />
|
||||
<wt:combobox field="Searcher.Type" items="Types" />
|
||||
<wt:combobox field="Searcher.Status" items="LocationStatus" />
|
||||
@ -11,9 +12,8 @@
|
||||
<wt:textbox field="Searcher.Layer" />
|
||||
<wt:textbox field="Searcher.RoadWay" />
|
||||
<wt:textbox field="Searcher.ContainerCode" />
|
||||
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
|
||||
<wt:combobox field="Searcher.IsStop" empty-text="@Localizer["Sys.All"]" />
|
||||
<wt:textbox field="Searcher.ContiguousCode" />
|
||||
@*<wt:textbox field="Searcher.ContiguousCode" />*@
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" url="/configs/Location/Search"/>
|
||||
|
||||
@ -16,7 +16,7 @@ namespace HHWMS.Web
|
||||
public ExcelPropety ContainerCode_Excel = ExcelPropety.CreateProperty<InventoryTransaction>(x => x.ContainerCode);
|
||||
|
||||
[Display(Name = "Container.LocationCode")]
|
||||
public ExcelPropety LocaionCode_Excel = ExcelPropety.CreateProperty<InventoryTransaction>(x => x.LocaionCode);
|
||||
public ExcelPropety LocationCode_Excel = ExcelPropety.CreateProperty<InventoryTransaction>(x => x.LocationCode);
|
||||
|
||||
[Display(Name = "Inventory.MaterialCode")]
|
||||
public ExcelPropety MaterialCode_Excel = ExcelPropety.CreateProperty<InventoryTransaction>(x => x.MaterialCode);
|
||||
|
||||
@ -29,7 +29,7 @@ namespace HHWMS.Web
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.Type),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.LocaionCode),
|
||||
this.MakeGridHeader(x => x.LocationCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
@ -57,7 +57,7 @@ namespace HHWMS.Web
|
||||
.CheckContain(Searcher.ZoneCode, x => x.ZoneCode)
|
||||
.CheckContain(Searcher.Type, x => x.Type)
|
||||
.CheckContain(Searcher.ContainerCode, x => x.ContainerCode)
|
||||
.CheckContain(Searcher.LocaionCode, x => x.LocaionCode)
|
||||
.CheckContain(Searcher.LocationCode, x => x.LocationCode)
|
||||
.CheckContain(Searcher.MaterialCode, x => x.MaterialCode)
|
||||
.CheckContain(Searcher.MaterialType, x => x.MaterialType)
|
||||
.CheckContain(Searcher.MaterialName, x => x.MaterialName)
|
||||
@ -75,7 +75,7 @@ namespace HHWMS.Web
|
||||
ZoneCode = x.ZoneCode,
|
||||
Type = x.Type,
|
||||
ContainerCode = x.ContainerCode,
|
||||
LocaionCode = x.LocaionCode,
|
||||
LocationCode = x.LocationCode,
|
||||
MaterialCode = x.MaterialCode,
|
||||
MaterialType = x.MaterialType,
|
||||
MaterialName = x.MaterialName,
|
||||
|
||||
@ -19,7 +19,7 @@ namespace HHWMS.Web
|
||||
[Display(Name = "Task.ContainerCode")]
|
||||
public String ContainerCode { get; set; }
|
||||
[Display(Name = "Container.LocationCode")]
|
||||
public String LocaionCode { get; set; }
|
||||
public String LocationCode { get; set; }
|
||||
[Display(Name = "Inventory.MaterialCode")]
|
||||
public String MaterialCode { get; set; }
|
||||
[Display(Name = "Inventory.MaterialType")]
|
||||
|
||||
@ -13,7 +13,7 @@ namespace HHWMS.Web
|
||||
public ExcelPropety ContainerCode_Excel = ExcelPropety.CreateProperty<Inventory>(x => x.ContainerCode);
|
||||
|
||||
[Display(Name = "Container.LocationCode")]
|
||||
public ExcelPropety LocaionCode_Excel = ExcelPropety.CreateProperty<Inventory>(x => x.LocaionCode);
|
||||
public ExcelPropety LocationCode_Excel = ExcelPropety.CreateProperty<Inventory>(x => x.LocationCode);
|
||||
|
||||
[Display(Name = "Inventory.MaterialCode")]
|
||||
public ExcelPropety MaterialCode_Excel = ExcelPropety.CreateProperty<Inventory>(x => x.MaterialCode);
|
||||
|
||||
@ -10,7 +10,9 @@ namespace HHWMS.Web
|
||||
{
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"inventory", dialogWidth: 800),
|
||||
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "inventory", dialogWidth: 800),
|
||||
@ -21,14 +23,24 @@ namespace HHWMS.Web
|
||||
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "inventory", dialogWidth: 800),
|
||||
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "inventory"),
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "inventory", dialogWidth: 800),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
protected override IEnumerable<IGridColumn<Inventory_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<Inventory_View>>{
|
||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
|
||||
{
|
||||
return new List<GridColumn<Inventory_View>>{
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.LocaionCode),
|
||||
this.MakeGridHeader(x => x.LocationCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
@ -49,12 +61,34 @@ namespace HHWMS.Web
|
||||
this.MakeGridHeader(x => x.TaskStatus),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<GridColumn<Inventory_View>>{
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.LocationCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.CompanyCode),
|
||||
this.MakeGridHeader(x => x.TaskQty),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeader(x => x.TaskStatus),
|
||||
this.MakeGridHeaderAction(width: 50)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<Inventory_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<Inventory>()
|
||||
.CheckContain(Searcher.ZoneCode, x => x.ZoneCode)
|
||||
.CheckContain(Searcher.LocationCode, x => x.LocationCode)
|
||||
.CheckContain(Searcher.MaterialCode, x => x.MaterialCode)
|
||||
.CheckContain(Searcher.MaterialType, x => x.MaterialType)
|
||||
.CheckContain(Searcher.MaterialName, x => x.MaterialName)
|
||||
@ -70,7 +104,7 @@ namespace HHWMS.Web
|
||||
ID = x.ID,
|
||||
ZoneCode = x.ZoneCode,
|
||||
ContainerCode = x.ContainerCode,
|
||||
LocaionCode = x.LocaionCode,
|
||||
LocationCode = x.LocationCode,
|
||||
MaterialCode = x.MaterialCode,
|
||||
MaterialType = x.MaterialType,
|
||||
MaterialName = x.MaterialName,
|
||||
|
||||
@ -14,6 +14,8 @@ namespace HHWMS.Web
|
||||
{
|
||||
[Display(Name = "Task.ZoneCode")]
|
||||
public String ZoneCode { get; set; }
|
||||
[Display(Name = "Inventory.LocationCode")]
|
||||
public String LocationCode { get; set; }
|
||||
[Display(Name = "Inventory.MaterialCode")]
|
||||
public String MaterialCode { get; set; }
|
||||
[Display(Name = "Inventory.MaterialType")]
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:textbox field="Entity.ZoneCode" />
|
||||
<wt:textbox field="Entity.ContainerCode" />
|
||||
<wt:textbox field="Entity.LocaionCode" />
|
||||
<wt:textbox field="Entity.LocationCode" />
|
||||
<wt:textbox field="Entity.MaterialCode" />
|
||||
<wt:textbox field="Entity.MaterialType" />
|
||||
<wt:textbox field="Entity.MaterialName" />
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:display field="Entity.ZoneCode" />
|
||||
<wt:display field="Entity.ContainerCode" />
|
||||
<wt:display field="Entity.LocaionCode" />
|
||||
<wt:display field="Entity.LocationCode" />
|
||||
<wt:display field="Entity.MaterialCode" />
|
||||
<wt:display field="Entity.MaterialType" />
|
||||
<wt:display field="Entity.MaterialName" />
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:display field="Entity.ZoneCode" />
|
||||
<wt:display field="Entity.ContainerCode" />
|
||||
<wt:display field="Entity.LocaionCode" />
|
||||
<wt:display field="Entity.LocationCode" />
|
||||
<wt:display field="Entity.MaterialCode" />
|
||||
<wt:display field="Entity.MaterialType" />
|
||||
<wt:display field="Entity.MaterialName" />
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:textbox field="Entity.ZoneCode" />
|
||||
<wt:textbox field="Entity.ContainerCode" />
|
||||
<wt:textbox field="Entity.LocaionCode" />
|
||||
<wt:textbox field="Entity.LocationCode" />
|
||||
<wt:textbox field="Entity.MaterialCode" />
|
||||
<wt:textbox field="Entity.MaterialType" />
|
||||
<wt:textbox field="Entity.MaterialName" />
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<wt:textbox field="Entity.ZoneCode" />
|
||||
<wt:textbox field="Entity.Type" />
|
||||
<wt:textbox field="Entity.ContainerCode" />
|
||||
<wt:textbox field="Entity.LocaionCode" />
|
||||
<wt:textbox field="Entity.LocationCode" />
|
||||
<wt:textbox field="Entity.MaterialCode" />
|
||||
<wt:textbox field="Entity.MaterialType" />
|
||||
<wt:textbox field="Entity.MaterialName" />
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<wt:display field="Entity.ZoneCode" />
|
||||
<wt:display field="Entity.Type" />
|
||||
<wt:display field="Entity.ContainerCode" />
|
||||
<wt:display field="Entity.LocaionCode" />
|
||||
<wt:display field="Entity.LocationCode" />
|
||||
<wt:display field="Entity.MaterialCode" />
|
||||
<wt:display field="Entity.MaterialType" />
|
||||
<wt:display field="Entity.MaterialName" />
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<wt:display field="Entity.ZoneCode" />
|
||||
<wt:display field="Entity.Type" />
|
||||
<wt:display field="Entity.ContainerCode" />
|
||||
<wt:display field="Entity.LocaionCode" />
|
||||
<wt:display field="Entity.LocationCode" />
|
||||
<wt:display field="Entity.MaterialCode" />
|
||||
<wt:display field="Entity.MaterialType" />
|
||||
<wt:display field="Entity.MaterialName" />
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<wt:textbox field="Entity.ZoneCode" />
|
||||
<wt:textbox field="Entity.Type" />
|
||||
<wt:textbox field="Entity.ContainerCode" />
|
||||
<wt:textbox field="Entity.LocaionCode" />
|
||||
<wt:textbox field="Entity.LocationCode" />
|
||||
<wt:textbox field="Entity.MaterialCode" />
|
||||
<wt:textbox field="Entity.MaterialType" />
|
||||
<wt:textbox field="Entity.MaterialName" />
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<wt:textbox field="Searcher.ZoneCode" />
|
||||
<wt:textbox field="Searcher.Type" />
|
||||
<wt:textbox field="Searcher.ContainerCode" />
|
||||
<wt:textbox field="Searcher.LocaionCode" />
|
||||
<wt:textbox field="Searcher.LocationCode" />
|
||||
<wt:textbox field="Searcher.MaterialCode" />
|
||||
<wt:textbox field="Searcher.MaterialType" />
|
||||
<wt:textbox field="Searcher.MaterialName" />
|
||||
|
||||
@ -25,8 +25,14 @@ namespace HHWMS.Web
|
||||
var _unitwork = new UnitWork(Wtm);
|
||||
|
||||
var taskList = _unitwork.Find<TaskHeader>(x => x.Status == TaskStatusEnum.新建).Take(10);
|
||||
var begin = new Location();
|
||||
var end = new Location();
|
||||
var locationCodeList = taskList.Select(x => x.FromLocation).Union(taskList.Select(x => x.ToLocation)).ToList();
|
||||
var locationList = _unitwork.Find<Location>(x => locationCodeList.Contains(x.Code)).ToList(); ;
|
||||
foreach (var task in taskList)
|
||||
{
|
||||
begin = locationList.FirstOrDefault(x => x.Code.Equals(task.FromLocation));
|
||||
end = locationList.FirstOrDefault(x => x.Code.Equals(task.ToLocation));
|
||||
var taskInfo = new TaskInfo
|
||||
{
|
||||
TaskId = task.TaskNo,
|
||||
@ -34,15 +40,15 @@ namespace HHWMS.Web
|
||||
ObjId = task.ContainerCode,
|
||||
StartPos = new CoordPos
|
||||
{
|
||||
X = int.Parse(task.FromLocation.Split("-")[2]),
|
||||
Y = int.Parse(task.FromLocation.Split("-")[1]),
|
||||
Z = int.Parse(task.FromLocation.Split("-")[3])
|
||||
X = begin.Line,
|
||||
Y = begin.Row,
|
||||
Z = begin.Layer
|
||||
},
|
||||
EndPos = new CoordPos
|
||||
{
|
||||
X = int.Parse(task.ToLocation.Split("-")[2]),
|
||||
Y = int.Parse(task.ToLocation.Split("-")[1]),
|
||||
Z = int.Parse(task.ToLocation.Split("-")[3])
|
||||
X = end.Line,
|
||||
Y = end.Row,
|
||||
Z = end.Layer
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using HHWMS.Web.Models;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@ -12,7 +15,15 @@ namespace HHWMS.Web.Controllers
|
||||
[ActionDescription("任务主表")]
|
||||
public partial class TaskHeaderController : BaseController
|
||||
{
|
||||
private readonly IUnitWork _unitwork;
|
||||
|
||||
public TaskHeaderController(IUnitWork unitwork)
|
||||
{
|
||||
_unitwork = unitwork;
|
||||
}
|
||||
|
||||
#region Search
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
@ -36,9 +47,10 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Search
|
||||
|
||||
#region Create
|
||||
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult Create()
|
||||
{
|
||||
@ -68,9 +80,11 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion Create
|
||||
|
||||
#region Edit
|
||||
|
||||
[ActionDescription("Sys.Edit")]
|
||||
public ActionResult Edit(string id)
|
||||
{
|
||||
@ -101,9 +115,11 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion Edit
|
||||
|
||||
#region Delete
|
||||
|
||||
[ActionDescription("Sys.Delete")]
|
||||
public ActionResult Delete(string id)
|
||||
{
|
||||
@ -126,18 +142,22 @@ namespace HHWMS.Web.Controllers
|
||||
return FFResult().CloseDialog().RefreshGrid();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion Delete
|
||||
|
||||
#region Details
|
||||
|
||||
[ActionDescription("Sys.Details")]
|
||||
public ActionResult Details(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<TaskHeaderVM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion Details
|
||||
|
||||
#region BatchEdit
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchEdit")]
|
||||
public ActionResult BatchEdit(string[] IDs)
|
||||
@ -152,16 +172,18 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchEdit())
|
||||
{
|
||||
return PartialView("BatchEdit",vm);
|
||||
return PartialView("BatchEdit", vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchEditSuccess", vm.Ids.Length]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion BatchEdit
|
||||
|
||||
#region BatchDelete
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchDelete")]
|
||||
public ActionResult BatchDelete(string[] IDs)
|
||||
@ -176,17 +198,19 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchDelete())
|
||||
{
|
||||
return PartialView("BatchDelete",vm);
|
||||
return PartialView("BatchDelete", vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchDeleteSuccess", vm.Ids.Length]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion BatchDelete
|
||||
|
||||
#region Import
|
||||
[ActionDescription("Sys.Import")]
|
||||
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import()
|
||||
{
|
||||
var vm = Wtm.CreateVM<TaskHeaderImportVM>();
|
||||
@ -206,16 +230,88 @@ namespace HHWMS.Web.Controllers
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.ImportSuccess", vm.EntityList.Count.ToString()]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion Import
|
||||
|
||||
#region Export
|
||||
|
||||
[ActionDescription("Sys.Export")]
|
||||
[HttpPost]
|
||||
public IActionResult ExportExcel(TaskHeaderListVM vm)
|
||||
{
|
||||
return vm.GetExportData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion Export
|
||||
|
||||
#region 任务下发
|
||||
|
||||
[ActionDescription("TaskHeader.Assign")]
|
||||
public ActionResult Assign(string id)
|
||||
{
|
||||
var task = _unitwork.Find<TaskHeader>(x => x.ID == int.Parse(id)).Include(x => x.TaskDetails).FirstOrDefault();
|
||||
if(task == null)
|
||||
return FFResult().RefreshGrid().Alert($"操作失败,此任务不存在!");
|
||||
var taskInfo = new TaskInfo();
|
||||
var beginlocation = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.FromLocation));
|
||||
var endLocation = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.ToLocation));
|
||||
var start = new CoordPos();
|
||||
var end = new CoordPos();
|
||||
if ((int)task.TaskType == 3 || (int)task.TaskType == 4)
|
||||
{
|
||||
// 盘料起点终点 与普通任务起点终点不一样,编码未在location中保存
|
||||
var taskdel = task.TaskDetails.FirstOrDefault(x => x.Status.Equals(TaskStatusEnum.新建));
|
||||
start.X = int.Parse(taskdel.Batch.Split("-")[0]);
|
||||
start.Y = int.Parse(taskdel.Batch.Split("-")[1]);
|
||||
start.Z = int.Parse(taskdel.Batch.Split("-")[2]);
|
||||
|
||||
end.X = int.Parse(taskdel.Lot.Split("-")[0]);
|
||||
end.Y = int.Parse(taskdel.Lot.Split("-")[1]);
|
||||
end.Z = int.Parse(taskdel.Lot.Split("-")[2]);
|
||||
|
||||
taskInfo.TaskId = taskdel.TaskHeader.TaskNo;
|
||||
taskInfo.TaskType = (int)task.TaskType;
|
||||
taskInfo.ObjId = taskdel.ContainerCode;
|
||||
taskInfo.StartType = int.Parse(task.Station);
|
||||
taskInfo.StartPos = start;
|
||||
taskInfo.EndType = int.Parse(task.Station);
|
||||
taskInfo.EndPos = end;
|
||||
}
|
||||
else
|
||||
{
|
||||
start.X = beginlocation.Line;
|
||||
start.Y = beginlocation.Row;
|
||||
start.Z = beginlocation.Layer;
|
||||
|
||||
end.X = endLocation.Line;
|
||||
end.Y = endLocation.Row;
|
||||
end.Z = endLocation.Layer;
|
||||
|
||||
taskInfo.TaskId = task.TaskNo;
|
||||
taskInfo.TaskType = (int)task.TaskType;
|
||||
taskInfo.ObjId = task.ContainerCode;
|
||||
taskInfo.StartType = int.Parse(task.Station);
|
||||
taskInfo.StartPos = start;
|
||||
taskInfo.EndType = int.Parse(task.Station);
|
||||
taskInfo.EndPos = end;
|
||||
}
|
||||
|
||||
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, taskInfo).Result.Data;
|
||||
try
|
||||
{
|
||||
if ((bool)res?.Success)
|
||||
{
|
||||
// 删除已回传MES的任务
|
||||
//_unitwork.Delete(item);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return FFResult().Alert($"操作失败,{ex.Message}");
|
||||
}
|
||||
return FFResult().RefreshGrid();
|
||||
}
|
||||
|
||||
#endregion 任务下发
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@ -25,6 +25,8 @@ namespace HHWMS.Web
|
||||
this.MakeStandardAction("TaskHeader", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "taskManage", dialogWidth: 800),
|
||||
this.MakeStandardAction("TaskHeader", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "taskManage", dialogWidth: 800),
|
||||
this.MakeStandardAction("TaskHeader", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "taskManage"),
|
||||
this.MakeAction("TaskHeader","Assign",Localizer["TaskHeader.Assign"],"",paraType: GridActionParameterTypesEnum.SingleId,areaName: "taskManage")
|
||||
.SetShowDialog(false),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ namespace HHWMS.Web.Models
|
||||
|
||||
[Display(Name = "Container.LocationCode", Description = "库位编码")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string LocaionCode { get; set; }
|
||||
public string LocationCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.MaterialCode", Description = "物料编码")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
|
||||
@ -27,7 +27,7 @@ namespace HHWMS.Web.Models
|
||||
|
||||
[Display(Name = "Container.LocationCode", Description = "库位编码")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string LocaionCode { get; set; }
|
||||
public string LocationCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.MaterialCode", Description = "物料编码")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
|
||||
@ -4,12 +4,39 @@ namespace HHWMS.Web.Models
|
||||
{
|
||||
public class TaskInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务号
|
||||
/// </summary>
|
||||
public string TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态类型,1:料盒入库 2:料盒出库 3:料盘入库 4:料盘出库 99:任务删除
|
||||
/// </summary>
|
||||
public int TaskType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 料盒号或者料盘号 取决于任务类型
|
||||
/// </summary>
|
||||
public string ObjId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 起点
|
||||
/// </summary>
|
||||
public CoordPos StartPos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 起点类型 1:小料塔 2:大料塔 3:小料盒 4:大料盒
|
||||
/// </summary>
|
||||
public int StartType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 终点
|
||||
/// </summary>
|
||||
public CoordPos EndPos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 终点类型 1:小料塔 2:大料塔 3:小料盒 4:大料盒
|
||||
/// </summary>
|
||||
public int EndType { get; set; }
|
||||
}
|
||||
|
||||
@ -22,10 +49,25 @@ namespace HHWMS.Web.Models
|
||||
|
||||
public class TaskResponse
|
||||
{
|
||||
public string taskId { get; set; }
|
||||
public int taskType { get; set; }
|
||||
public string objId { get; set; }
|
||||
public int resut { get; set; }
|
||||
/// <summary>
|
||||
/// 任务号
|
||||
/// </summary>
|
||||
public string TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态类型,1:料盒入库 2:料盒出库 3:料盘入库 4:料盘出库
|
||||
/// </summary>
|
||||
public int TaskType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 料盒号或者料盘号 取决于任务类型
|
||||
/// </summary>
|
||||
public string ObjId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 响应结果 100:任务完成, 99:任务失败
|
||||
/// </summary>
|
||||
public int Resut { get; set; }
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -104,8 +104,8 @@
|
||||
"github2": {
|
||||
"Address": "https://api.github.com"
|
||||
},
|
||||
"mainhost": {
|
||||
// "Address": "https://localhost:5001"
|
||||
"WCS": {
|
||||
"Address": "http://localhost:5003/api/IWMS/"
|
||||
}
|
||||
},
|
||||
"AppSettings": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user