添加项目文件。
This commit is contained in:
1 parent
05e131ca4e
commit
514d6f5255
1162 files changed
+81255
No files matched your search
@@ -0,0 +1,24 @@
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class ContainerBatchVM : BaseBatchVM<Container, Container_BatchEdit>
|
||||
{
|
||||
public ContainerBatchVM()
|
||||
{
|
||||
ListVM = new ContainerListVM();
|
||||
LinkedVM = new Container_BatchEdit();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class to define batch edit fields
|
||||
/// </summary>
|
||||
public class Container_BatchEdit : BaseVM
|
||||
{
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class ContainerTemplateVM : BaseTemplateVM
|
||||
{
|
||||
[Display(Name = "Container.Code")]
|
||||
public ExcelPropety Code_Excel = ExcelPropety.CreateProperty<Container>(x => x.Code);
|
||||
|
||||
[Display(Name = "Container.Type")]
|
||||
public ExcelPropety Type_Excel = ExcelPropety.CreateProperty<Container>(x => x.Type);
|
||||
|
||||
[Display(Name = "Container.IsLock")]
|
||||
public ExcelPropety IsLock_Excel = ExcelPropety.CreateProperty<Container>(x => x.IsLock);
|
||||
|
||||
[Display(Name = "Container.Status")]
|
||||
public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<Container>(x => x.Status);
|
||||
|
||||
[Display(Name = "Container.LocationCode")]
|
||||
public ExcelPropety LocationCode_Excel = ExcelPropety.CreateProperty<Container>(x => x.LocationCode);
|
||||
|
||||
[Display(Name = "System.Length")]
|
||||
public ExcelPropety Length_Excel = ExcelPropety.CreateProperty<Container>(x => x.Length);
|
||||
|
||||
[Display(Name = "System.Width")]
|
||||
public ExcelPropety Width_Excel = ExcelPropety.CreateProperty<Container>(x => x.Width);
|
||||
|
||||
[Display(Name = "System.Height")]
|
||||
public ExcelPropety Height_Excel = ExcelPropety.CreateProperty<Container>(x => x.Height);
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class ContainerImportVM : BaseImportVM<ContainerTemplateVM, Container>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class ContainerListVM : BasePagedListVM<Container_View, ContainerSearcher>
|
||||
{
|
||||
public List<ComboSelectListItem> ContainerType { get; set; }
|
||||
public List<ComboSelectListItem> ContainerStatus { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ContainerVM>();
|
||||
ContainerType = vm.ContainerType;
|
||||
ContainerStatus = vm.ContainerStatus;
|
||||
}
|
||||
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("Container", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Container", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Container", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Container", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Container", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Container", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Container", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Container", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
|
||||
this.MakeAction("Container","AddContainer",Localizer["Container.AddContainer"],Localizer["Container.AddContainer"],GridActionParameterTypesEnum.NoId,"configs"),
|
||||
};
|
||||
}
|
||||
|
||||
protected override IEnumerable<IGridColumn<Container_View>> InitGridHeader()
|
||||
{
|
||||
InitVM();
|
||||
return new List<GridColumn<Container_View>>{
|
||||
this.MakeGridHeader(x => x.Code),
|
||||
this.MakeGridHeader(x => x.Type)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = ContainerType.FirstOrDefault(x => x.Value.ToString() == a.Type);
|
||||
return data?.Text ?? a.Type;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.IsLock),
|
||||
this.MakeGridHeader(x => x.Status)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = ContainerStatus.FirstOrDefault(x => x.Value.ToString() == a.Status);
|
||||
return data?.Text ?? a.Status;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.LocationCode),
|
||||
this.MakeGridHeader(x => x.Length),
|
||||
this.MakeGridHeader(x => x.Width),
|
||||
this.MakeGridHeader(x => x.Height),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<Container_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<Container>()
|
||||
.CheckContain(Searcher.Code, x => x.Code)
|
||||
.CheckContain(Searcher.Type, x => x.Type)
|
||||
.CheckEqual(Searcher.IsLock, x => x.IsLock)
|
||||
.CheckContain(Searcher.Status, x => x.Status)
|
||||
.CheckContain(Searcher.LocationCode, x => x.LocationCode)
|
||||
.CheckEqual(Searcher.Length, x => x.Length)
|
||||
.CheckEqual(Searcher.Width, x => x.Width)
|
||||
.CheckEqual(Searcher.Height, x => x.Height)
|
||||
.Select(x => new Container_View
|
||||
{
|
||||
ID = x.ID,
|
||||
Code = x.Code,
|
||||
Type = x.Type,
|
||||
IsLock = x.IsLock,
|
||||
Status = x.Status,
|
||||
LocationCode = x.LocationCode,
|
||||
Length = x.Length,
|
||||
Width = x.Width,
|
||||
Height = x.Height,
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
}
|
||||
}
|
||||
|
||||
public class Container_View : Container
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class ContainerSearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "Container.Code")]
|
||||
public String Code { get; set; }
|
||||
|
||||
[Display(Name = "Container.Type")]
|
||||
public String Type { get; set; }
|
||||
|
||||
[Display(Name = "Container.IsLock")]
|
||||
public ContainerLockEnum? IsLock { get; set; }
|
||||
|
||||
[Display(Name = "Container.Status")]
|
||||
public String Status { get; set; }
|
||||
|
||||
[Display(Name = "Container.LocationCode")]
|
||||
public String LocationCode { get; set; }
|
||||
|
||||
[Display(Name = "System.Length")]
|
||||
public Decimal? Length { get; set; }
|
||||
|
||||
[Display(Name = "System.Width")]
|
||||
public Decimal? Width { get; set; }
|
||||
|
||||
[Display(Name = "System.Height")]
|
||||
public Decimal? Height { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class ContainerVM : BaseCRUDVM<Container>
|
||||
{
|
||||
[Display(Name = "Container.Num", Description = "数量")]
|
||||
public Int32 Num { get; set; }
|
||||
|
||||
public List<ComboSelectListItem> ContainerType { get; set; }
|
||||
public List<ComboSelectListItem> ContainerStatus { get; set; }
|
||||
|
||||
public ContainerVM()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
var CurrentCulture = Wtm.CurrentCulture;
|
||||
var dictDatas = DC.Set<SysDictData>().ToList();
|
||||
ContainerType = dictDatas.Where(x => x.DictType == "ContainerType").Select(x => new ComboSelectListItem
|
||||
{
|
||||
Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
||||
Value = x.DictValue
|
||||
}).ToList();
|
||||
ContainerStatus = dictDatas.Where(x => x.DictType == "ContainerStatus").Select(x => new ComboSelectListItem
|
||||
{
|
||||
Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
||||
Value = x.DictValue
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public override void DoAdd()
|
||||
{
|
||||
base.DoAdd();
|
||||
}
|
||||
|
||||
public override void DoEdit(bool updateAllFields = false)
|
||||
{
|
||||
base.DoEdit(updateAllFields);
|
||||
}
|
||||
|
||||
public override void DoDelete()
|
||||
{
|
||||
base.DoDelete();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class LocationBatchVM : BaseBatchVM<Location, Location_BatchEdit>
|
||||
{
|
||||
public LocationBatchVM()
|
||||
{
|
||||
ListVM = new LocationListVM();
|
||||
LinkedVM = new Location_BatchEdit();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class to define batch edit fields
|
||||
/// </summary>
|
||||
public class Location_BatchEdit : BaseVM
|
||||
{
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class LocationTemplateVM : BaseTemplateVM
|
||||
{
|
||||
[Display(Name = "Location.Code")]
|
||||
public ExcelPropety Code_Excel = ExcelPropety.CreateProperty<Location>(x => x.Code);
|
||||
|
||||
[Display(Name = "Location.Type")]
|
||||
public ExcelPropety Type_Excel = ExcelPropety.CreateProperty<Location>(x => x.Type);
|
||||
|
||||
[Display(Name = "Location.Status")]
|
||||
public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<Location>(x => x.Status);
|
||||
|
||||
[Display(Name = "Location.Row")]
|
||||
public ExcelPropety Row_Excel = ExcelPropety.CreateProperty<Location>(x => x.Row);
|
||||
|
||||
[Display(Name = "Location.Line")]
|
||||
public ExcelPropety Line_Excel = ExcelPropety.CreateProperty<Location>(x => x.Line);
|
||||
|
||||
[Display(Name = "Location.Layer")]
|
||||
public ExcelPropety Layer_Excel = ExcelPropety.CreateProperty<Location>(x => x.Layer);
|
||||
|
||||
[Display(Name = "Location.RoadWay")]
|
||||
public ExcelPropety RoadWay_Excel = ExcelPropety.CreateProperty<Location>(x => x.RoadWay);
|
||||
|
||||
[Display(Name = "Location.ContainerCode")]
|
||||
public ExcelPropety ContainerCode_Excel = ExcelPropety.CreateProperty<Location>(x => x.ContainerCode);
|
||||
|
||||
[Display(Name = "Location.ZoneCode")]
|
||||
public ExcelPropety ZoneCode_Excel = ExcelPropety.CreateProperty<Location>(x => x.ZoneCode);
|
||||
|
||||
[Display(Name = "Location.IsStop")]
|
||||
public ExcelPropety IsStop_Excel = ExcelPropety.CreateProperty<Location>(x => x.IsStop);
|
||||
|
||||
[Display(Name = "System.Length")]
|
||||
public ExcelPropety Length_Excel = ExcelPropety.CreateProperty<Location>(x => x.Length);
|
||||
|
||||
[Display(Name = "System.Width")]
|
||||
public ExcelPropety Width_Excel = ExcelPropety.CreateProperty<Location>(x => x.Width);
|
||||
|
||||
[Display(Name = "System.Height")]
|
||||
public ExcelPropety Height_Excel = ExcelPropety.CreateProperty<Location>(x => x.Height);
|
||||
|
||||
[Display(Name = "Location.ContiguousCode")]
|
||||
public ExcelPropety ContiguousCode_Excel = ExcelPropety.CreateProperty<Location>(x => x.ContiguousCode);
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class LocationImportVM : BaseImportVM<LocationTemplateVM, Location>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class LocationListVM : BasePagedListVM<Location_View, LocationSearcher>
|
||||
{
|
||||
public List<ComboSelectListItem> ZoneCodes { get; set; }
|
||||
public List<ComboSelectListItem> Types { get; set; }
|
||||
public List<ComboSelectListItem> LocationStatus { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
var vm = Wtm.CreateVM<LocationVM>();
|
||||
ZoneCodes = vm.ZoneCodes;
|
||||
Types = vm.Types;
|
||||
LocationStatus = vm.LocationStatus;
|
||||
}
|
||||
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("Location", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Location", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Location", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Location", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Location", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Location", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Location", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("Location", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
|
||||
this.MakeAction("Location","AddLocation",Localizer["Location.AddLocation"],Localizer["Location.AddLocation"],GridActionParameterTypesEnum.NoId,"configs"),
|
||||
};
|
||||
}
|
||||
|
||||
protected override IEnumerable<IGridColumn<Location_View>> InitGridHeader()
|
||||
{
|
||||
InitVM();
|
||||
return new List<GridColumn<Location_View>>{
|
||||
this.MakeGridHeader(x => x.ZoneCode)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = ZoneCodes.FirstOrDefault(x => x.Value.ToString() == a.ZoneCode);
|
||||
return data?.Text ?? a.ZoneCode;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Code, 120),
|
||||
this.MakeGridHeader(x => x.Type)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = Types.FirstOrDefault(x => x.Value.ToString() == a.Type);
|
||||
return data?.Text ?? a.Type;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Status)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = LocationStatus.FirstOrDefault(x => x.Value.ToString() == a.Status);
|
||||
return data?.Text ?? a.Status;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Row),
|
||||
this.MakeGridHeader(x => x.Line),
|
||||
this.MakeGridHeader(x => x.Layer),
|
||||
this.MakeGridHeader(x => x.RoadWay),
|
||||
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.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<Location_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<Location>()
|
||||
.CheckContain(Searcher.Code, x => x.Code)
|
||||
.CheckContain(Searcher.Type, x => x.Type)
|
||||
.CheckContain(Searcher.Status, x => x.Status)
|
||||
.CheckEqual(Searcher.Row, x => x.Row)
|
||||
.CheckEqual(Searcher.Line, x => x.Line)
|
||||
.CheckEqual(Searcher.Layer, x => x.Layer)
|
||||
.CheckEqual(Searcher.RoadWay, x => x.RoadWay)
|
||||
.CheckContain(Searcher.ContainerCode, x => x.ContainerCode)
|
||||
.CheckContain(Searcher.ZoneCode, x => x.ZoneCode)
|
||||
.CheckEqual(Searcher.IsStop, x => x.IsStop)
|
||||
.CheckContain(Searcher.ContiguousCode, x => x.ContiguousCode)
|
||||
.Select(x => new Location_View
|
||||
{
|
||||
ID = x.ID,
|
||||
Code = x.Code,
|
||||
Type = x.Type,
|
||||
Status = x.Status,
|
||||
Row = x.Row,
|
||||
Line = x.Line,
|
||||
Layer = x.Layer,
|
||||
RoadWay = x.RoadWay,
|
||||
ContainerCode = x.ContainerCode,
|
||||
ZoneCode = x.ZoneCode,
|
||||
IsStop = x.IsStop,
|
||||
Length = x.Length,
|
||||
Width = x.Width,
|
||||
Height = x.Height,
|
||||
ContiguousCode = x.ContiguousCode,
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
}
|
||||
}
|
||||
|
||||
public class Location_View : Location
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class LocationSearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "Location.Code")]
|
||||
public String Code { get; set; }
|
||||
|
||||
[Display(Name = "Location.Type")]
|
||||
public String Type { get; set; }
|
||||
|
||||
[Display(Name = "Location.Status")]
|
||||
public String Status { get; set; }
|
||||
|
||||
[Display(Name = "Location.Row")]
|
||||
public Int16? Row { get; set; }
|
||||
|
||||
[Display(Name = "Location.Line")]
|
||||
public Int16? Line { get; set; }
|
||||
|
||||
[Display(Name = "Location.Layer")]
|
||||
public Int16? Layer { get; set; }
|
||||
|
||||
[Display(Name = "Location.RoadWay")]
|
||||
public Int16? RoadWay { get; set; }
|
||||
|
||||
[Display(Name = "Location.ContainerCode")]
|
||||
public String ContainerCode { get; set; }
|
||||
|
||||
[Display(Name = "Location.ZoneCode")]
|
||||
public String ZoneCode { get; set; }
|
||||
|
||||
[Display(Name = "Location.IsStop")]
|
||||
public Boolean? IsStop { get; set; }
|
||||
|
||||
[Display(Name = "Location.ContiguousCode")]
|
||||
public String ContiguousCode { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class LocationVM : BaseCRUDVM<Location>
|
||||
{
|
||||
[Display(Name = "Location.BeginLine", Description = "起始列")]
|
||||
[Required(ErrorMessage = "Validate.{0}required")]
|
||||
public short BeginLine { get; set; }
|
||||
|
||||
[Display(Name = "Location.BeginLayer", Description = "起始层")]
|
||||
[Required(ErrorMessage = "Validate.{0}required")]
|
||||
public short BeginLayer { get; set; }
|
||||
|
||||
[Display(Name = "Location.RoadwayType", Description = "巷道类型")]
|
||||
[Required(ErrorMessage = "Validate.{0}required")]
|
||||
public short RoadwayType { get; set; }
|
||||
|
||||
private IUnitWork _unitWork { get; set; }
|
||||
|
||||
public List<ComboSelectListItem> RoadwayTypes { get; set; }
|
||||
public List<ComboSelectListItem> ZoneCodes { get; set; }
|
||||
public List<ComboSelectListItem> Types { get; set; }
|
||||
public List<ComboSelectListItem> LocationStatus { get; set; }
|
||||
|
||||
public LocationVM()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
_unitWork = new UnitWork(Wtm);
|
||||
var CurrentCulture = Wtm.CurrentCulture;
|
||||
var dictDatas = DC.Set<SysDictData>().ToList();
|
||||
RoadwayTypes = dictDatas.Where(x => x.DictType == "RoadwayType").Select(x => new ComboSelectListItem
|
||||
{
|
||||
Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
||||
Value = x.DictValue
|
||||
}).ToList();
|
||||
ZoneCodes = dictDatas.Where(x => x.DictType == "ZoneCode").Select(x => new ComboSelectListItem
|
||||
{
|
||||
Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
||||
Value = x.DictValue
|
||||
}).ToList();
|
||||
Types = dictDatas.Where(x => x.DictType == "LocationType").Select(x => new ComboSelectListItem
|
||||
{
|
||||
Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
||||
Value = x.DictValue
|
||||
}).ToList();
|
||||
LocationStatus = dictDatas.Where(x => x.DictType == "LocationStatus").Select(x => new ComboSelectListItem
|
||||
{
|
||||
Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
||||
Value = x.DictValue
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public override void DoAdd()
|
||||
{
|
||||
base.DoAdd();
|
||||
}
|
||||
|
||||
public override void DoEdit(bool updateAllFields = false)
|
||||
{
|
||||
base.DoEdit(updateAllFields);
|
||||
}
|
||||
|
||||
public override void DoDelete()
|
||||
{
|
||||
base.DoDelete();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找库位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public ResponseResult<dynamic> GetLocation(WcsRequest request)
|
||||
{
|
||||
var res = ResponseResult<dynamic>.Success(new {LocationCode = "test"});
|
||||
return res;
|
||||
//return GetOutEmptyLocation(request);
|
||||
/*if (request.RoadWay == null)
|
||||
{
|
||||
// 根据条件查询巷道 (巷道均分,根据托盘类型分)
|
||||
request.RoadWay = SelectRoadWay(request);
|
||||
if(SelectRoadWay(request) == 0)
|
||||
{
|
||||
return ResponseResult<dynamic>.Error("未找到可用巷道!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 查询该巷道类型 调用不同的方法
|
||||
return GetLocationByOne(request);
|
||||
}
|
||||
return "";*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单伸位 查找仓位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetLocationByOne(WcsRequest request)
|
||||
{
|
||||
// 根据托盘类型/传入的长宽高 查找库位
|
||||
var locationList = _unitWork.Find<Location>(x => x.RoadWay == request.RoadWay);
|
||||
locationList = locationList.WhereIf(request.Length > 0, x => x.Length == request.Length)
|
||||
.WhereIf(request.Width > 0, x => x.Width == request.Width)
|
||||
.WhereIf(request.Height > 0, x => x.Height >= request.Height)
|
||||
.OrderBy(x => x.Height);
|
||||
var location = locationList.OrderBy(x => x.Layer)
|
||||
.ThenBy(x => x.Line)
|
||||
.FirstOrDefault();
|
||||
return location?.Code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 双伸位 查找仓位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetLocationByTwo(WcsRequest request)
|
||||
{
|
||||
// 根据托盘类型 查找库位 todo
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 双伸位,获取里仓位有货,外仓位无货的仓位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetOutEmptyLocation(WcsRequest request)
|
||||
{
|
||||
int roadWay = (int)request.RoadWay;
|
||||
var locationList = _unitWork.Find<Location>(x => x.RoadWay == roadWay)
|
||||
.Join(_unitWork.Find<Location>(x => x.RoadWay == roadWay),
|
||||
a => a.ContiguousCode, g => g.Code,
|
||||
(a, g) => new
|
||||
{
|
||||
a.Code,
|
||||
a.Status,
|
||||
a.RowFlag,
|
||||
a.Layer,
|
||||
a.Line,
|
||||
ContiguousCode = g.Code,
|
||||
Status1 = g.Status
|
||||
}).ToList();
|
||||
var location = locationList.Where(x => x.RowFlag == 0 && x.Status == "empty" && x.Status1 == "some")
|
||||
.OrderBy(x => x.Layer)
|
||||
.ThenBy(x => x.Line)
|
||||
.FirstOrDefault()?.Code;
|
||||
return location;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 双伸位,获取里外仓位都为空的仓位
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="rowFlag">0 返回外仓位,1返回里仓位</param>
|
||||
/// <returns></returns>
|
||||
public string GetAllEmptyLocation(WcsRequest request, int rowFlag)
|
||||
{
|
||||
int roadWay = (int)request.RoadWay;
|
||||
var locationList = _unitWork.Find<Location>(x => x.RoadWay == roadWay)
|
||||
.Join(_unitWork.Find<Location>(x => x.RoadWay == roadWay),
|
||||
a => a.ContiguousCode, g => g.Code,
|
||||
(a, g) => new
|
||||
{
|
||||
a.Code,
|
||||
a.Status,
|
||||
a.RowFlag,
|
||||
a.Layer,
|
||||
a.Line,
|
||||
ContiguousCode = g.Code,
|
||||
Status1 = g.Status
|
||||
}).ToList();
|
||||
var location = locationList.Where(x => x.RowFlag == rowFlag && x.Status == "empty" && x.Status1 == "empty")
|
||||
.OrderBy(x => x.Layer)
|
||||
.ThenBy(x => x.Line)
|
||||
.FirstOrDefault()?.Code;
|
||||
return location;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据传入条件,查找可利用巷道
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public int SelectRoadWay(WcsRequest request)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user